Camel debug is not working
Bug description
-
jbang '-Dcamel.jbang.version=4.6.0' camel@apache/camel init 'Demo.java' -
jbang '-Dcamel.jbang.version=4.6.0' camel@apache/camel export --runtime=quarkus --gav=com.acme:myproject:1.0-SNAPSHOT -
mvn quarkus:dev -Pcamel.debug - Connect with jconsole
- Go to the Route MBean operations and call
suspend - it i logged
INFO [org.apa.cam.imp.eng.AbstractCamelContext] (RMI TCP Connection(10)-127.0.0.1) Suspended route1 (timer://java)but the route is still executed
I tried also with camel.jbang.version 4.7.0-SNAPSHOT which is genrating project with Camel Quarkus 3.12.0
Something similar was mentioned elsewhere recently.
It is likely related to CQ configuring NoShutdownStrategy in dev mode. It prohibits route suspension.
You can suppress it by setting a property like camel.main.shutdownTimeout=30.
calling mvn quarkus:dev -Pcamel.debug -Dcamel.main.shutdownTimeout=30 is effectively working. Thanks for the workaround.
What is the purpose of this NoShutdownStrategy in dev mode? And why would it prevent to suspend/stop routes?
Would it be possible to modify this strategy when the camel-quarkus-debug depdency is on the classpath?
What is the purpose of this NoShutdownStrategy in dev mode?
I think the original intent was that if you're running in dev mode, you're probably looking to iterate quickly. I.e you don't want hot reloading to take a long time due to waiting for inflight messages to complete etc.
And why would it prevent to suspend/stop routes?
Because it's effectively a noop implementation of ShutdownStrategy.
Would it be possible to modify this strategy when the camel-quarkus-debug depdency is on the classpath?
Yes, that should be possible. Or alternatively, we could implement suspend logic in NoShutdownStrategy (maybe by delegating to DefaultShutdownStrategy).