From de5824797fe7d765d4cdeb4f5a8b1aebed2ed9d4 Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Fri, 9 Feb 2024 04:09:29 -0600 Subject: [PATCH] Fix startup and EPP ordering (#5670) --- .../server/config/DefaultEnvironmentPostProcessor.java | 8 +++++++- .../main/resources/META-INF/dataflow-server-defaults.yml | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DefaultEnvironmentPostProcessor.java b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DefaultEnvironmentPostProcessor.java index 04b9be420d..b194c043e7 100644 --- a/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DefaultEnvironmentPostProcessor.java +++ b/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DefaultEnvironmentPostProcessor.java @@ -26,6 +26,7 @@ import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; import org.springframework.boot.SpringApplication; +import org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor; import org.springframework.boot.env.EnvironmentPostProcessor; import org.springframework.core.Ordered; import org.springframework.core.env.ConfigurableEnvironment; @@ -49,6 +50,11 @@ public class DefaultEnvironmentPostProcessor implements EnvironmentPostProcessor private static final Logger logger = LoggerFactory.getLogger(DefaultEnvironmentPostProcessor.class); + /** + * The order for the processor - must run before the {@link ConfigDataEnvironmentPostProcessor}. + */ + public static final int ORDER = ConfigDataEnvironmentPostProcessor.ORDER - 5; + private final Resource serverResource = new ClassPathResource("/dataflow-server.yml"); private final Resource serverDefaultsResource = new ClassPathResource("META-INF/dataflow-server-defaults.yml"); @@ -106,6 +112,6 @@ public void postProcessEnvironment(ConfigurableEnvironment environment, SpringAp @Override public int getOrder() { - return 0; + return ORDER; } } diff --git a/spring-cloud-dataflow-server-core/src/main/resources/META-INF/dataflow-server-defaults.yml b/spring-cloud-dataflow-server-core/src/main/resources/META-INF/dataflow-server-defaults.yml index 5e54466c57..3d61c067bd 100644 --- a/spring-cloud-dataflow-server-core/src/main/resources/META-INF/dataflow-server-defaults.yml +++ b/spring-cloud-dataflow-server-core/src/main/resources/META-INF/dataflow-server-defaults.yml @@ -52,6 +52,8 @@ server: error: include-message: always spring: + config: + use-legacy-processing: true mvc.async.request-timeout: 120000 batch: initialize-schema: never