davsclaus opened a new pull request, #31035: URL: https://github.com/apache/camel/pull/31035
JIRA: https://issues.apache.org/jira/browse/CAMEL-27696 ## What was wrong - **camel-jgroups-raft**: when `channelProperties` is not set (endpoint or component), `JGroupsRaftEndpoint.resolveHandle()` creates the JChannel from `raft.xml`, which is the file in the `camel-jgroups-raft` JAR unless the application has its own `raft.xml` first. The `JGroupsRaftClusterService` uses the same file by default (`jgroupsConfig`). That file is a sample: UDP multicast (228.5.5.5), no `AUTH` and no `SYM_ENCRYPT`/`ASYM_ENCRYPT`, and `A` as the only RAFT member. Any host on the same multicast network with the same cluster name can join the cluster and take part in the Raft log, and the messages are sent in clear text. The option text only said that the file lists A as the only member. - **camel-jgroups**: without `channel` and `channelProperties`, `JGroupsEndpoint.resolveChannel()` uses `new JChannel()`, the default `udp.xml` of JGroups (also no AUTH or encryption). The doc page already explained this in its Security section, but the option text was only "Specifies configuration properties of the JChannel used by the endpoint." and nothing was logged. ## What changed - `channelProperties` option text (component and endpoint, both components) and `jgroupsConfig` of `JGroupsRaftClusterService`: the default is meant for development and tests; in production set your own configuration with AUTH and SYM_ENCRYPT or ASYM_ENCRYPT (and, for raft, the members of the cluster in the `members` attribute of RAFT). - A WARN is logged when an endpoint starts with the default configuration (`JGroupsRaftEndpoint.resolveHandle()`, `JGroupsEndpoint.resolveChannel()`), and when the cluster service creates its RaftHandle from the default `raft.xml`. This is once per start, not per message. No WARN when `channelProperties` (or `raftHandle` / the component `channel`) is set. - The protocol stack of the bundled `raft.xml` is not changed. - Docs: new "Channel configuration" section on the jgroups-raft page; one paragraph added to the Security section of the jgroups page. - Upgrade guide 4.24: a short note about the new WARN (nothing else changes). - Regenerated: component JSON (+ catalog copies), the `JGroupsRaftClusterService` bean JSON (+ catalog copy), the catalog doc copies, endpoint DSL and component DSL. ## Tests - `JGroupsRaftDefaultConfigWarningTest` (3 tests): WARN once without channelProperties (also when the same endpoint is looked up again); no WARN with channelProperties on the endpoint or on the component. - `JGroupsRaftClusterServiceDefaultConfigWarningTest` (2 tests): WARN with the default jgroupsConfig, none with a configured one. - `JGroupsDefaultChannelWarningTest` (3 tests): the same for camel-jgroups. - The WARN is captured with a small log4j2 test appender (`WarnCapture`), attached once the LoggerContext is started, and the messages are matched on a unique cluster name or raft id so parallel test classes do not interfere. The endpoint tests do not connect the channels; the cluster service tests use the shared loopback configuration of the test resources and a raft id that is not a member (a Learner, no election). - Without the fix, the three "warns..." tests fail and the "noWarning..." tests pass. With the fix, all tests of both modules pass (42 in camel-jgroups-raft, 50 in camel-jgroups). _Claude Code on behalf of Claus Ibsen_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
