This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-spring-boot-3.4.x
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/camel-spring-boot-3.4.x by
this push:
new 973f24e Fixed spring-boot to not create thread pool profile if there
was no configuration for it.
973f24e is described below
commit 973f24e3559c90d5f8201d169cf0b820e6582a22
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Jul 27 07:11:36 2020 +0200
Fixed spring-boot to not create thread pool profile if there was no
configuration for it.
---
.../threadpool/CamelThreadPoolAutoConfiguration.java | 5 ++++-
.../CamelThreadPoolConfigurationProperties.java | 20 ++++++--------------
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/threadpool/CamelThreadPoolAutoConfiguration.java
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/threadpool/CamelThreadPoolAutoConfiguration.java
index 78f69b7..7706f0d 100644
---
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/threadpool/CamelThreadPoolAutoConfiguration.java
+++
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/threadpool/CamelThreadPoolAutoConfiguration.java
@@ -20,7 +20,6 @@ import org.apache.camel.CamelContext;
import org.apache.camel.builder.ThreadPoolProfileBuilder;
import org.apache.camel.spi.ThreadPoolProfile;
import org.apache.camel.spring.boot.CamelAutoConfiguration;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import
org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -35,6 +34,10 @@ public class CamelThreadPoolAutoConfiguration {
@Bean
public ThreadPoolProfile threadPool(CamelContext camelContext,
CamelThreadPoolConfigurationProperties tp) {
+ if (tp.isEmpty()) {
+ return null;
+ }
+
// okay we have all properties set so we should be able to create
thread pool profiles and register them on camel
ThreadPoolProfile defaultProfile =
camelContext.getExecutorServiceManager().getDefaultThreadPoolProfile();
final ThreadPoolProfile dp = new ThreadPoolProfileBuilder("default",
defaultProfile)
diff --git
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/threadpool/CamelThreadPoolConfigurationProperties.java
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/threadpool/CamelThreadPoolConfigurationProperties.java
index 01b8210..bd7e027 100644
---
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/threadpool/CamelThreadPoolConfigurationProperties.java
+++
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/threadpool/CamelThreadPoolConfigurationProperties.java
@@ -132,6 +132,12 @@ public class CamelThreadPoolConfigurationProperties {
this.config = config;
}
+ public boolean isEmpty() {
+ return poolSize == null && maxPoolSize == null && keepAliveTime ==
null && timeUnit == null
+ && maxQueueSize == null && allowCoreThreadTimeOut == null &&
rejectedPolicy == null
+ && config.isEmpty();
+ }
+
@ConfigurationProperties(prefix = "camel.health.config")
public static class ThreadPoolProfileConfigurationProperties {
@@ -241,20 +247,6 @@ public class CamelThreadPoolConfigurationProperties {
this.rejectedPolicy = rejectedPolicy;
}
- /*public HealthCheckConfiguration toHealthCheckConfiguration() {
- HealthCheckConfiguration answer = new HealthCheckConfiguration();
- answer.setParent(parent);
- if (enabled != null) {
- answer.setEnabled(enabled);
- }
- if (interval != null) {
- answer.setInterval(interval);
- }
- if (failureThreshold != null) {
- answer.setFailureThreshold(failureThreshold);
- }
- return answer;
- }*/
}
}