spring-cloud-stream
spring-cloud-stream copied to clipboard
banner - log -output triggered a second time by child-application (due to org.springframework.cloud.stream.binder.DefaultBinderFactory)
@christianlorenzhmmh commented on Wed Aug 14 2019
We have a springBootApplication usinging banner-mode "COSOLE" to output some ASCII-banner on startup.
Recently we added the dependencies
-
spring-cloud-starter-stream-kafka
-
spring-cloud-starter-netflix-hystrix
-
spring-cloud-netflix-hystrix-stream
in our spring-boot-application where one of them (or all in cooperation) internally starts a "child"-springApplication within
org.springframework.cloud.stream.binder.DefaultBinderFactory.java
(Row 290)
ConfigurableApplicationContext binderProducingContext = springApplicationBuilder
.run(args.toArray(new String[0]));
There the properties of the our main application ("parent"-application) is added and then on the internally triggered startup of the child-application the banner is AGAIN printed here:
printBanner:546, SpringApplication (org.springframework.boot)
run:306, SpringApplication (org.springframework.boot)
run:139, SpringApplicationBuilder (org.springframework.boot.builder)
getBinderInstance:291, DefaultBinderFactory (org.springframework.cloud.stream.binder)
doGetBinder:192, DefaultBinderFactory (org.springframework.cloud.stream.binder)
getBinder:130, DefaultBinderFactory (org.springframework.cloud.stream.binder)
getBinder:337, BindingService (org.springframework.cloud.stream.binding)
bindProducer:229, BindingService (org.springframework.cloud.stream.binding)
createAndBindOutputs:287, BindableProxyFactory (org.springframework.cloud.stream.binding)
doStartWithBindable:58, OutputBindingLifecycle (org.springframework.cloud.stream.binding)
accept:-1, 1440374606 (org.springframework.cloud.stream.binding.AbstractBindingLifecycle$$Lambda$1043)
forEach:608, LinkedHashMap$LinkedValues (java.util)
start:48, AbstractBindingLifecycle (org.springframework.cloud.stream.binding)
start:34, OutputBindingLifecycle (org.springframework.cloud.stream.binding)
doStart:182, DefaultLifecycleProcessor (org.springframework.context.support)
access$200:53, DefaultLifecycleProcessor (org.springframework.context.support)
start:360, DefaultLifecycleProcessor$LifecycleGroup (org.springframework.context.support)
startBeans:158, DefaultLifecycleProcessor (org.springframework.context.support)
onRefresh:122, DefaultLifecycleProcessor (org.springframework.context.support)
finishRefresh:893, AbstractApplicationContext (org.springframework.context.support)
finishRefresh:161, ServletWebServerApplicationContext (org.springframework.boot.web.servlet.context)
refresh:552, AbstractApplicationContext (org.springframework.context.support)
refresh:140, ServletWebServerApplicationContext (org.springframework.boot.web.servlet.context)
refresh:742, SpringApplication (org.springframework.boot)
refreshContext:389, SpringApplication (org.springframework.boot)
run:311, SpringApplication (org.springframework.boot)
run:1213, SpringApplication (org.springframework.boot)
run:1202, SpringApplication (org.springframework.boot)
main:14, Application (de.bonprix)
invoke0:-1, NativeMethodAccessorImpl (jdk.internal.reflect)
invoke:62, NativeMethodAccessorImpl (jdk.internal.reflect)
invoke:43, DelegatingMethodAccessorImpl (jdk.internal.reflect)
invoke:566, Method (java.lang.reflect)
run:49, RestartLauncher (org.springframework.boot.devtools.restart)
I can see that the parent-context is provided to the child-application - and within this also the banner-mode (CONSOLE).
I could not figure out how to prevent this second banner-log-output.
Best Regards Christian
@christianlorenzhmmh: Could you share the versions in use?
Hello Sabby,
thanx for contacting me.
Believing my IDE the three mentioned dependencies would be:
/.m2/repository/org/springframework/cloud/spring-cloud-starter-netflix-hystrix/2.1.2.RELEASE/spring-cloud-starter-netflix-hystrix-2.1.2.RELEASE.pom
/.m2/repository/org/springframework/cloud/spring-cloud-netflix-hystrix-stream/2.1.2.RELEASE/spring-cloud-netflix-hystrix-stream-2.1.2.RELEASE.pom
/.m2/repository/org/springframework/cloud/spring-cloud-starter-stream-kafka/2.1.3.RELEASE/spring-cloud-starter-stream-kafka-2.1.3.RELEASE.pom
The dependencies towards spring-boot are:
Please let me know if the provided info is sufficient for you (or if you need more pom.xml or stuff like that).
Best Regards from Bremen (Germany),
Christian