云版本是 Brixton.SR1....
我使用 sping-cloud-bus-kafka 和 sping-cloud-zookeeper-all (使用 zookeeper 来发现),每次,zookeeper 中有两个项目,如:
zookeeper 数据: zookeeper 数据图像
我的 yml 是: 我的 yml
启动时,它创建了两次applicationcontext,两次kafka producer,两次zookeeperclient,堆栈跟踪是:
第一次:
Thread [main] (Suspended (breakpoint at line 765 in ZooKeeper))
ZooKeeper.create(String, byte[], List<ACL>, CreateMode) line: 765
CreateBuilderImpl$11.call() line: 721
CreateBuilderImpl$11.call() line: 704
RetryLoop.callWithRetry(CuratorZookeeperClient, Callable<T>) line: 108
CreateBuilderImpl.pathInForeground(String, byte[]) line: 701
CreateBuilderImpl.protectedPathInForeground(String, byte[]) line: 477
CreateBuilderImpl.forPath(String, byte[]) line: 467
CreateBuilderImpl.forPath(String, byte[]) line: 44
ServiceDiscoveryImpl<T>.internalRegisterService(ServiceInstance<T>) line: 224
ServiceDiscoveryImpl<T>.reRegisterServices() line: 444
ServiceDiscoveryImpl<T>.start() line: 131
ZookeeperLifecycle.register() line: 55
ZookeeperLifecycle(AbstractDiscoveryLifecycle).start() line: 102
DefaultLifecycleProcessor.doStart(Map<String,Lifecycle>, String, boolean) line: 173
DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor, Map, String, boolean) line: 51
DefaultLifecycleProcessor$LifecycleGroup.start() line: 346
DefaultLifecycleProcessor.startBeans(boolean) line: 149
DefaultLifecycleProcessor.onRefresh() line: 112
AnnotationConfigApplicationContext(AbstractApplicationContext).finishRefresh() line: 852
AnnotationConfigApplicationContext(AbstractApplicationContext).refresh() line: 541
SpringApplication.refresh(ApplicationContext) line: 766
SpringApplication.createAndRefreshContext(SpringApplicationRunListeners, ApplicationArguments) line: 361
SpringApplication.run(String...) line: 307
SpringApplicationBuilder.run(String...) line: 134
BootstrapApplicationListener.bootstrapServiceContext(ConfigurableEnvironment, SpringApplication) line: 140
BootstrapApplicationListener.onApplicationEvent(ApplicationEnvironmentPreparedEvent) line: 84
BootstrapApplicationListener.onApplicationEvent(ApplicationEvent) line: 62
SimpleApplicationEventMulticaster.invokeListener(ApplicationListener, ApplicationEvent) line: 166
SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent, ResolvableType) line: 138
SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent) line: 121
EventPublishingRunListener.publishEvent(SpringApplicationEvent) line: 111
EventPublishingRunListener.environmentPrepared(ConfigurableEnvironment) line: 65
SpringApplicationRunListeners.environmentPrepared(ConfigurableEnvironment) line: 54
SpringApplication.createAndRefreshContext(SpringApplicationRunListeners, ApplicationArguments) line: 330
SpringApplication.run(String...) line: 307
BaseApplication.main(String[]) line: 42
Hello.main(String[]) line: 15
第二次 :
Thread [main] (Suspended (breakpoint at line 765 in ZooKeeper))
ZooKeeper.create(String, byte[], List<ACL>, CreateMode) line: 765
CreateBuilderImpl$11.call() line: 721
CreateBuilderImpl$11.call() line: 704
RetryLoop.callWithRetry(CuratorZookeeperClient, Callable<T>) line: 108
CreateBuilderImpl.pathInForeground(String, byte[]) line: 701
CreateBuilderImpl.protectedPathInForeground(String, byte[]) line: 477
CreateBuilderImpl.forPath(String, byte[]) line: 467
CreateBuilderImpl.forPath(String, byte[]) line: 44
ServiceDiscoveryImpl<T>.internalRegisterService(ServiceInstance<T>) line: 224
ServiceDiscoveryImpl<T>.reRegisterServices() line: 444
ServiceDiscoveryImpl<T>.start() line: 131
ZookeeperLifecycle.register() line: 55
ZookeeperLifecycle(AbstractDiscoveryLifecycle).start() line: 102
DefaultLifecycleProcessor.doStart(Map<String,Lifecycle>, String, boolean) line: 173
DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor, Map, String, boolean) line: 51
DefaultLifecycleProcessor$LifecycleGroup.start() line: 346
DefaultLifecycleProcessor.startBeans(boolean) line: 149
DefaultLifecycleProcessor.onRefresh() line: 112
AnnotationConfigApplicationContext(AbstractApplicationContext).finishRefresh() line: 852
AnnotationConfigApplicationContext(AbstractApplicationContext).refresh() line: 541
SpringApplication.refresh(ApplicationContext) line: 766
SpringApplication.createAndRefreshContext(SpringApplicationRunListeners, ApplicationArguments) line: 361
SpringApplication.run(String...) line: 307
SpringApplicationBuilder.run(String...) line: 134
BootstrapApplicationListener.bootstrapServiceContext(ConfigurableEnvironment, SpringApplication) line: 140
BootstrapApplicationListener.onApplicationEvent(ApplicationEnvironmentPreparedEvent) line: 84
BootstrapApplicationListener.onApplicationEvent(ApplicationEvent) line: 62
SimpleApplicationEventMulticaster.invokeListener(ApplicationListener, ApplicationEvent) line: 166
SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent, ResolvableType) line: 138
SimpleApplicationEventMulticaster.multicastEvent(ApplicationEvent) line: 121
EventPublishingRunListener.publishEvent(SpringApplicationEvent) line: 111
EventPublishingRunListener.environmentPrepared(ConfigurableEnvironment) line: 65
SpringApplicationRunListeners.environmentPrepared(ConfigurableEnvironment) line: 54
SpringApplication.createAndRefreshContext(SpringApplicationRunListeners, ApplicationArguments) line: 330
SpringApplication.run(String...) line: 307
SpringApplicationBuilder.run(String...) line: 134
DefaultBinderFactory<T>.getBinder(String) line: 156
ChannelBindingService.getBinderForChannel(String) line: 142
ChannelBindingService.bindProducer(MessageChannel, String) line: 104
BindableProxyFactory.bindOutputs(ChannelBindingService) line: 205
OutputBindingLifecycle.start() line: 57
DefaultLifecycleProcessor.doStart(Map<String,Lifecycle>, String, boolean) line: 173
DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor, Map, String, boolean) line: 51
DefaultLifecycleProcessor$LifecycleGroup.start() line: 346
DefaultLifecycleProcessor.startBeans(boolean) line: 149
DefaultLifecycleProcessor.onRefresh() line: 112
AnnotationConfigEmbeddedWebApplicationContext(AbstractApplicationContext).finishRefresh() line: 852
AnnotationConfigEmbeddedWebApplicationContext(EmbeddedWebApplicationContext).finishRefresh() line: 140
AnnotationConfigEmbeddedWebApplicationContext(AbstractApplicationContext).refresh() line: 541
AnnotationConfigEmbeddedWebApplicationContext(EmbeddedWebApplicationContext).refresh() line: 118
SpringApplication.refresh(ApplicationContext) line: 766
SpringApplication.createAndRefreshContext(SpringApplicationRunListeners, ApplicationArguments) line: 361
SpringApplication.run(String...) line: 307
BaseApplication.main(String[]) line: 42
Hello.main(String[]) line: 15
谁知道会发生什么????
谢谢.....