spring云总线kafka创建applicationcontext两次

7gs2gvoe  于 2021-06-07  发布在  Kafka
关注(0)|答案(0)|浏览(226)

云版本是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

谁知道会发生什么????
谢谢。。。。。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题