Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camel debug is not working #6256

Open
apupier opened this issue Jul 5, 2024 · 3 comments
Open

Camel debug is not working #6256

apupier opened this issue Jul 5, 2024 · 3 comments
Labels
area/debug bug Something isn't working

Comments

@apupier
Copy link
Contributor

apupier commented Jul 5, 2024

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

@apupier apupier added the bug Something isn't working label Jul 5, 2024
@jamesnetherton
Copy link
Contributor

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.

@apupier
Copy link
Contributor Author

apupier commented Jul 5, 2024

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?

@jamesnetherton
Copy link
Contributor

jamesnetherton commented Jul 5, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/debug bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants