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 22
33import com .ctrip .framework .apollo .spring .annotation .EnableApolloConfig ;
44import org .slf4j .LoggerFactory ;
5+ import org .springframework .boot .WebApplicationType ;
56import org .springframework .boot .autoconfigure .SpringBootApplication ;
67import org .springframework .boot .builder .SpringApplicationBuilder ;
78import org .springframework .cloud .client .discovery .EnableDiscoveryClient ;
@@ -20,7 +21,7 @@ public class ApolloSampleApplication {
2021 private static final org .slf4j .Logger log = LoggerFactory .getLogger (ApolloSampleApplication .class );
2122
2223 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 ();
2425 log .info (
2526 "\n ----------------------------------------------------------\n \t "
2627 + "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 11package cn .springcloud .gray .service .consumer .nacos .connfig ;
22
33import org .slf4j .LoggerFactory ;
4+ import org .springframework .boot .WebApplicationType ;
45import org .springframework .boot .autoconfigure .SpringBootApplication ;
56import org .springframework .boot .builder .SpringApplicationBuilder ;
67import org .springframework .cloud .client .discovery .EnableDiscoveryClient ;
@@ -18,7 +19,7 @@ public class NacosConsumerApplication {
1819 private static final org .slf4j .Logger log = LoggerFactory .getLogger (NacosConsumerApplication .class );
1920
2021 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 ();
2223 log .info (
2324 "\n ----------------------------------------------------------\n \t "
2425 + "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 5555 <!-- </dependency>-->
5656
5757
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>-->
6262
6363 </dependencies >
6464
Original file line number Diff line number Diff line change 11server :
22 port : 20203
33spring :
4+ main :
5+ allow-bean-definition-overriding : true
46 application :
57 name : gray-Server
68
@@ -31,24 +33,19 @@ spring:
3133 server-addr : 127.0.0.1:8848
3234 stream :
3335 bindings :
34- # GrayEventInput:
35- # group: service-a
36- # destination: test
37- # consumer:
38- # concurrency: 1 #并发数
39- # max-attempts: 1
4036 GrayEventOutput :
37+ contentType : application/x-java-serialized-object
4138 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
5249eureka :
5350 client :
5451 register-with-eureka : true
@@ -60,7 +57,9 @@ eureka:
6057gray :
6158 server :
6259 cluster :
63- peer-nodes :
60+ # synchro:
61+ # enable: false
62+ peerNodes :
6463 - host : localhost
6564 port : 20202
6665 - host : localhost
You can’t perform that action at this time.
0 commit comments