These are chat archives for spring-cloud/spring-cloud
spring-boot-starter-webfluxdependency the problem persists. The
Running environment post processor...log shows twice in the app's output.
Hi, after some reading I can only assume that an
EnvironmentPostProcessor is run for each of the application contexts being initialized and for a Spring Cloud project the additional run comes from running the bootstrap context. In the Spring Cloud documentation there is a following statement:
... Note that the SpringApplicationBuilder allows you to share an Environment amongst the whole hierarchy, but that is not the default...
How can I make the environment be shared among different context hierarchy? I tried invoking the
.environment method like this:
new SpringApplicationBuilder(MyApplication.class) .environment(new StandardEnvironment()) .build() .run(args);
It did not help. My post processor still runs twice with separate property sources.
I finally ended up with the following:
System.setProperty("spring.cloud.bootstrap.enabled", "false"); SpringApplication.run(MyApplication.class, args);
Now, my environment post processor is run once with all the property sources merged. Ufff ;)
@SpringBootTest(webEnvironment = RANDOM_PORT, properties = "spring.cloud.bootstrap.enabled = false")for each of my tests :/
@Componentand autowire through the constructor?
hi i am getting
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
but i dont use Database in the service, whats that?