CAMEL-24500: camel-debug-starter does not open a JMX connector by default - #1928
Merged
Merged
Conversation
…ault
camel.debug.jmx-connector-enabled now defaults to false.
Adding camel-debug-starter to the classpath still installs and enables the
BacklogDebugger, since asking for a starter named "debug" is the operator's
intent to debug. It no longer also creates an RMI registry and a JMX RMI
server on camel.debug.jmx-connector-port (1099).
Opening that socket is a second effect beyond enabling the debugger, and it is
not signalled by the dependency name. In camel-main the same option is only
reached after camel.debug.enabled is explicitly set, which defaults to false
there; in the starter the debugger is on as soon as the jar is present, so the
dependency alone was enough to start listening. The connector is created
without authentication or transport security.
The connector must now be requested:
camel.debug.jmx-connector-enabled = true
The camel debug command of Camel JBang is unaffected: for Spring Boot it
drives the application through the CLI connector of camel-cli-connector-starter,
not through JMX.
Adds CamelDebugAutoConfigurationDefaultTest, asserting the debugger is
installed and no DebuggerJmxConnectorService is started, and
CamelDebugAutoConfigurationJmxConnectorTest, asserting the connector starts
and listens once enabled. Documents the connector, and that it is
unauthenticated, in the starter docs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Croway
force-pushed
the
CAMEL-24500-debug-starter-defaults
branch
from
September 2, 2026 13:11
0d2d49a to
a7a02ae
Compare
oscerd
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes CAMEL-24500.
What
camel.debug.jmx-connector-enablednow defaults tofalseincamel-debug-starter.Adding the starter to the classpath still installs and enables the
BacklogDebugger— that is what the starter is for, and asking for a dependency nameddebugis the operator's intent to debug. It no longer also creates an RMI registry and a JMX RMI server oncamel.debug.jmx-connector-port(1099).Why
CamelDebugAutoConfigurationis@ConditionalOnProperty(matchIfMissing = true)andCamelDebugConfigurationProperties.enableddefaults totrue, withstandbyfalse.DefaultConfigurationConfigurer.configureBacklogDebuggerreturns early only when the debugger is neither enabled nor in standby, so with the starter present it always reached:Opening a listening socket is a second effect beyond installing the debugger, and nothing in the dependency name says so. camel-main reaches the same code only after
camel.debug.enabledis explicitly turned on (it defaults tofalsethere), so the connector is always the result of a deliberatecamel.debug.*setting; in the starter, the jar alone was enough. The connector is created withJMXConnectorServerFactory.newJMXConnectorServer(url, null, server)— no authentication and no transport security — and1099is the well-known RMI registry port, so it can also collide with an application's own JMX registry.Why not default
enabledtofalse(orstandbytotrue)That was the alternative in the ticket. It was not taken because it would break the reason the starter exists:
camel-debug-starteris only ever added on purpose, and a debugger that does nothing after being added is a worse default than one that debugs but does not listen. DefaultingjmxConnectorEnabledtofalsekeeps the starter useful out of the box and removes the only effect that reaches outside the process.Behaviour change and how to opt back in
Tooling that attaches to the debugger from another process — the IntelliJ IDEA and VS Code Camel plugins — needs the connector and must now request it:
The starter docs now state that the connector is unauthenticated and must be bound to loopback or firewalled.
camel debugfrom Camel JBang is unaffected:Debug.doRunDebugSpringBootaddscamel-cli-connector-starterand drives the application through the local CLI connector, not through JMX. It never setcamel.debug.jmxConnector*.An upgrade-guide entry for
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adocinapache/camelhas been drafted and will be raised separately.Tests
New in
components-starter/camel-debug-starter:CamelDebugAutoConfigurationDefaultTest— the debugger is installed and enabled,isJmxConnectorEnabled()isfalseon both the starter properties and theDebuggerConfigurationPropertiesbean, andcamelContext.hasService(DebuggerJmxConnectorService.class)isnull, so no connector is started.CamelDebugAutoConfigurationJmxConnectorTest— withcamel.debug.jmx-connector-enabled=trueon a free port, theDebuggerJmxConnectorServiceis present and started, and the port accepts a TCP connection (awaited with Awaitility).mvn install -pl components-starter/camel-debug-starter→ BUILD SUCCESS,Tests run: 5, Failures: 0, Errors: 0, Skipped: 0.Regenerated by the module build and committed:
src/main/docs/debug.jsonanddocs/spring-boot/modules/ROOT/pages/starters/debug.adoc.Claude Code (Opus 5) on behalf of Federico Mariani