1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

以2.2.1.BUILD-SNAPSHOT 为基准,适配Greenwich版本的Spring Cloud

This commit is contained in:
theonefx
2020-04-03 14:14:47 +08:00
parent e963a39bd4
commit 9444117f59
654 changed files with 7971 additions and 17442 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 the original author or authors.
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.examples.rocketmq;
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -31,7 +32,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* RocketMQ Bus Spring Application
* RocketMQ Bus Spring Application.
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @since 0.2.1
@@ -64,8 +65,7 @@ public class RocketMQBusApplication {
private ObjectMapper objectMapper;
/**
* Publish the {@link UserRemoteApplicationEvent}
*
* Publish the {@link UserRemoteApplicationEvent}.
* @param name the user name
* @param destination the destination
* @return If published
@@ -82,8 +82,7 @@ public class RocketMQBusApplication {
}
/**
* Listener on the {@link UserRemoteApplicationEvent}
*
* Listener on the {@link UserRemoteApplicationEvent}.
* @param event {@link UserRemoteApplicationEvent}
*/
@EventListener
@@ -98,4 +97,5 @@ public class RocketMQBusApplication {
System.out.printf("Server [port : %d] listeners on %s\n", localServerPort,
objectMapper.writeValueAsString(event));
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 the original author or authors.
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,10 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.examples.rocketmq;
/**
* User Domain
* User Domain.
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @since 0.2.1
@@ -47,4 +48,5 @@ public class User {
public String toString() {
return "User{" + "id=" + id + ", name='" + name + '\'' + '}';
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 the original author or authors.
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,12 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.cloud.examples.rocketmq;
import org.springframework.cloud.bus.event.RemoteApplicationEvent;
/**
* {@link User} {@link RemoteApplicationEvent}
* {@link User} {@link RemoteApplicationEvent}.
*
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
* @since 0.2.1
@@ -43,4 +44,5 @@ public class UserRemoteApplicationEvent extends RemoteApplicationEvent {
public User getUser() {
return user;
}
}

View File

@@ -1,4 +1,4 @@
spring.application.name=spring-cloud-bus-rocketmq-example
spring.cloud.stream.rocketmq.binder.name-server=127.0.0.1:9876
server.port=8080
spring.cloud.bus.id=${spring.application.name}:${server.port}
spring.cloud.bus.id=${spring.application.name}:${server.port}