This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-spring-boot-4.10.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-4.10.x by
this push:
new 97523b04de2 CAMEL-22141: camel-main: Fix duplicate route id detect
when you load multiple routes on startup (such as via camel-jbang)
97523b04de2 is described below
commit 97523b04de2b88baf2c129b77fceeb67128169db
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Jun 5 16:37:35 2025 +0200
CAMEL-22141: camel-main: Fix duplicate route id detect when you load
multiple routes on startup (such as via camel-jbang)
---
.../apache/camel/spring/boot/CamelSpringBootApplicationListener.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
index d7e01d5de73..bf24427b397 100644
---
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
+++
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationListener.java
@@ -89,9 +89,10 @@ public class CamelSpringBootApplicationListener implements
ApplicationListener<C
if (event.getApplicationContext() == this.applicationContext &&
camelContext.getStatus().isStopped()) {
LOG.debug("Post-processing CamelContext bean: {}",
camelContext.getName());
+ RoutesConfigurer configurer = new RoutesConfigurer(camelContext);
try {
// we can use the default routes configurer
- RoutesConfigurer configurer = new RoutesConfigurer();
+ ServiceHelper.startService(configurer);
if
(configurationProperties.getMain().isRoutesCollectorEnabled()) {
configurer.setRoutesCollector(springBootRoutesCollector);
@@ -227,6 +228,8 @@ public class CamelSpringBootApplicationListener implements
ApplicationListener<C
}
} catch (Exception e) {
throw new CamelSpringBootInitializationException(e);
+ } finally {
+ ServiceHelper.stopService(configurer);
}
} else {
LOG.debug("Camel already started, not adding routes.");