File tree Expand file tree Collapse file tree 4 files changed +24
-23
lines changed
spring-cloud-gray-samples
spring-cloud-gray-apollo-config-sample/src/main/java/cn/springcloud/gray/apollo/sample
spring-cloud-gray-consumer-nacos-config-sample/src/main/java/cn/springcloud/gray/service/consumer/nacos/connfig
spring-cloud-gray-server2-sample
src/main/resources/config Expand file tree Collapse file tree 4 files changed +24
-23
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import com .ctrip .framework .apollo .spring .annotation .EnableApolloConfig ;
4
4
import org .slf4j .LoggerFactory ;
5
+ import org .springframework .boot .WebApplicationType ;
5
6
import org .springframework .boot .autoconfigure .SpringBootApplication ;
6
7
import org .springframework .boot .builder .SpringApplicationBuilder ;
7
8
import org .springframework .cloud .client .discovery .EnableDiscoveryClient ;
@@ -20,7 +21,7 @@ public class ApolloSampleApplication {
20
21
private static final org .slf4j .Logger log = LoggerFactory .getLogger (ApolloSampleApplication .class );
21
22
22
23
public static void main (String [] args ) throws UnknownHostException {
23
- Environment env = new SpringApplicationBuilder (ApolloSampleApplication .class ).web (true ).run (args ).getEnvironment ();
24
+ Environment env = new SpringApplicationBuilder (ApolloSampleApplication .class ).web (WebApplicationType . SERVLET ).run (args ).getEnvironment ();
24
25
log .info (
25
26
"\n ----------------------------------------------------------\n \t "
26
27
+ "Application '{}' is running! Access URLs:\n \t " + "Local: \t \t http://127.0.0.1:{}\n \t "
Original file line number Diff line number Diff line change 1
1
package cn .springcloud .gray .service .consumer .nacos .connfig ;
2
2
3
3
import org .slf4j .LoggerFactory ;
4
+ import org .springframework .boot .WebApplicationType ;
4
5
import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
6
import org .springframework .boot .builder .SpringApplicationBuilder ;
6
7
import org .springframework .cloud .client .discovery .EnableDiscoveryClient ;
@@ -18,7 +19,7 @@ public class NacosConsumerApplication {
18
19
private static final org .slf4j .Logger log = LoggerFactory .getLogger (NacosConsumerApplication .class );
19
20
20
21
public static void main (String [] args ) throws UnknownHostException {
21
- Environment env = new SpringApplicationBuilder (NacosConsumerApplication .class ).web (true ).run (args ).getEnvironment ();
22
+ Environment env = new SpringApplicationBuilder (NacosConsumerApplication .class ).web (WebApplicationType . SERVLET ).run (args ).getEnvironment ();
22
23
log .info (
23
24
"\n ----------------------------------------------------------\n \t "
24
25
+ "Application '{}' is running! Access URLs:\n \t " + "Local: \t \t http://127.0.0.1:{}\n \t "
Original file line number Diff line number Diff line change 55
55
<!-- </dependency>-->
56
56
57
57
58
- <!-- <dependency>-->
59
- <!-- <groupId>cn.springcloud.gray </groupId>-->
60
- <!-- <artifactId>spring-cloud-gray-server-plugin-event- stream</artifactId>-->
61
- <!-- </dependency>-->
58
+ <!-- <dependency>-->
59
+ <!-- <groupId>org.springframework.cloud </groupId>-->
60
+ <!-- <artifactId>spring-cloud-starter- stream-rabbit </artifactId>-->
61
+ <!-- </dependency>-->
62
62
63
63
</dependencies >
64
64
Original file line number Diff line number Diff line change 1
1
server :
2
2
port : 20203
3
3
spring :
4
+ main :
5
+ allow-bean-definition-overriding : true
4
6
application :
5
7
name : gray-Server
6
8
@@ -31,24 +33,19 @@ spring:
31
33
server-addr : 127.0.0.1:8848
32
34
stream :
33
35
bindings :
34
- # GrayEventInput:
35
- # group: service-a
36
- # destination: test
37
- # consumer:
38
- # concurrency: 1 #并发数
39
- # max-attempts: 1
40
36
GrayEventOutput :
37
+ contentType : application/x-java-serialized-object
41
38
destination : gray_event
42
- # rabbit:
43
- # bindings:
44
- # GrayEventInput:
45
- # consumer:
46
- # maxConcurrency: 1 #并发数
47
- # prefetch: 1 #从mq一次获取消息的数量
48
- # requeueRejected: true #spring cloud stream 如果出现异常, 是否需要重新投递消息, false表示丢弃。 也有相应的Exception, true-MessageRejectedWhileStoppingException false-AmqpRejectAndDontRequeueException
49
- # auto-bind-dlq: true
50
- # acknowledgeMode: AUTO
51
- # acknowledgeMode: MANUAL
39
+ rabbit :
40
+ bindings :
41
+ GrayEventInput :
42
+ consumer :
43
+ maxConcurrency : 1 # 并发数
44
+ prefetch : 1 # 从mq一次获取消息的数量
45
+ requeueRejected : true # spring cloud stream 如果出现异常, 是否需要重新投递消息, false表示丢弃。 也有相应的Exception, true-MessageRejectedWhileStoppingException false-AmqpRejectAndDontRequeueException
46
+ auto-bind-dlq : true
47
+ acknowledgeMode : AUTO
48
+ acknowledgeMode : MANUAL
52
49
eureka :
53
50
client :
54
51
register-with-eureka : true
@@ -60,7 +57,9 @@ eureka:
60
57
gray :
61
58
server :
62
59
cluster :
63
- peer-nodes :
60
+ # synchro:
61
+ # enable: false
62
+ peerNodes :
64
63
- host : localhost
65
64
port : 20202
66
65
- host : localhost
You can’t perform that action at this time.
0 commit comments