allthingssecurity opened a new pull request, #30993: URL: https://github.com/apache/camel/pull/30993
# Description [CAMEL-27605](https://issues.apache.org/jira/browse/CAMEL-27605) The ticket lists four problems of camel-infinispan-embedded that came up while the option descriptions were written for CAMEL-23832 (#30944). I checked each one against main. Two are fixed here, two are left as they are. Fixed: 1. **eventTypes accepted event types that the consumer never receives.** The listener of the consumer (`InfinispanEmbeddedEventListener`) has callbacks for 9 of the 16 `Event.Type` values, so with `TOPOLOGY_CHANGED`, `CACHE_ENTRY_EVICTED`, the `TRANSACTION_*` types, `DATA_REHASHED`, `PARTITION_STATUS_CHANGED` or `PERSISTENCE_AVAILABILITY_CHANGED` the route started and never got those events, and nothing was logged. The consumer now logs a WARN when it starts that names the types it never receives and the ones it does. I chose a WARN over failing the start, so a route that lists such a type next to a received one keeps working as before. The names are now trimmed, so `CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED` no longer fails the start with an `IllegalArgumentException`, and empty names are skipped. The set of received types is an unmodifiable constant, no shared mutable state. 2. **cacheContainer, cacheContainerConfiguration, configurationUri and flags are ignored on an endpoint.** Every endpoint uses the one cache manager of the component, created from the component configuration, and its flags. The doc page already says so. The endpoint now also logs a WARN that names those of the four options whose value differs from the value of the component. The options stay on the endpoint, so the Endpoint DSL does not change. Not changed: 3. **CamelInfinispanOldValue has label producer.** The constant is in camel-infinispan-common and is shared with the infinispan (remote) component, whose consumer does not set it, so label `common` would be wrong there. #30944 says in its description that the embedded consumer sets it for `CACHE_ENTRY_REMOVED`. 4. **CamelInfinispanCurrentState is always false.** This is true for the built-in listeners. A consumer option for `includeCurrentState` needs listener variants whose `@Listener` sets it, and the header set for `CACHE_ENTRY_CREATED` events, which is how Infinispan delivers the existing entries (the created callback does not set the header today). That is a new feature rather than a fix. Removing the header metadata would remove a generated Endpoint DSL header method. #30944 describes when the header is true. No upgrade guide entry: the change adds WARN logs and accepts names with spaces; nothing that worked before behaves differently. Overlap with #30944: different lines in the Java sources (it changes annotations and descriptions; this changes `createEndpoint`, the consumer handler and the listener). Both change the doc page, in different paragraphs. Its descriptions stay correct: the component-only options are "not used" on an endpoint (now with a WARN), and its `eventTypes` description lists the 9 received types. Tests (new, unit test with the default in-JVM cache manager of the component, no server): - `InfinispanEmbeddedEventTypesAndEndpointOptionsTest`: `eventTypes` with a space receives the created and removed events; `TOPOLOGY_CHANGED` next to `CACHE_ENTRY_CREATED` logs a WARN that names only the type that is not received; an endpoint with `flags` and `configurationUri` logs a WARN that names both, and an endpoint without them logs none. Against the main sources all 3 fail (the route with a space fails to start, no WARN is logged). Results (offline, module build of camel-infinispan-embedded, test phase): 107 tests run, 0 failures, 0 errors. Two classes that start JGroups clustered cache managers (`InfinispanEmbeddedClusteredConsumerTest`, `InfinispanEmbeddedRepositoriesInMemoryTest`) hang on this machine without this change too, so I left them out; they do not use the changed code paths. The new test class passes 5 runs in a row. The local repository had Infinispan 16.3.0 and not 16.3.1, so I built with 16.3.0. Generated files: none (no option metadata changed). The catalog copy of the doc page has the same change as the doc page. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it): [CAMEL-27605](https://issues.apache.org/jira/browse/CAMEL-27605). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (I built camel-infinispan-embedded and ran its unit tests. The catalog copy of the doc page was updated by hand, as an offline build of the catalog was not possible here. I did not run the full root build.) # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer. _Claude Code on behalf of allthingssecurity_ 🤖 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]
