allthingssecurity opened a new pull request, #30989: URL: https://github.com/apache/camel/pull/30989
# Description [CAMEL-27620](https://issues.apache.org/jira/browse/CAMEL-27620) Fixes the two points of the ticket, found while the option descriptions of camel-browse were improved for CAMEL-23832 (#30958). I checked both against main first; both are real. 1. **The filter option also stopped the exchange from reaching the consumer** (fixed). The producer tested the filter before it called `onExchange()`, which adds the exchange to the browse list and also passes it to the route that consumes from the endpoint. With a filter, that route silently lost every exchange the filter did not keep. Before #30958 the option was described as "filter whether to include the message for browsing", so I read the behavior as a bug rather than intended. `onExchange()` now applies the filter only to adding the exchange to the list, and always passes the exchange to the consumer. Routes that only send to a browse endpoint, or that consume from one without a filter, behave as before. 2. **Browsed exchanges are live references** (documented, no code change, as the ticket proposes). The doc page now says that the endpoint keeps the exchanges themselves, so later steps change what is browsed, and that a wire tap sends a copy (with its own headers; a mutable body object is still shared). It also says what the filter does. The catalog copy of the doc page is updated. User-visible change: a route that consumes from a browse endpoint with a filter now gets the exchanges the filter does not keep. The 4.24 upgrade guide has a short entry for it. Overlap with #30958 (merged today): it rewrote the filter description to say "A skipped message is also not passed to the route that consumes from the endpoint." That is exactly the behavior this change removes, so the two cannot both stand. This branch is now based on main with #30958 and changes that sentence to "The filter only chooses what is browsed: the route that consumes from the endpoint gets every message." The component JSON, its catalog copy and `BrowseEndpointBuilderFactory` of the endpoint DSL are regenerated for it. If you would rather keep the old behavior and the #30958 text, point 1 of this PR should be dropped instead. Tests: `BrowseFilterConsumerTest` (in camel-core, next to the other browse tests) checks that the consuming route gets all four exchanges while the browse list keeps only the two the filter accepts. It fails on main (the route gets only the filtered ones) and passes with the fix, 5 runs in a row. The camel-core browse tests pass on the rebased branch: 17 run, 0 failures, 0 errors. # 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-27620](https://issues.apache.org/jira/browse/CAMEL-27620). # 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-browse and camel-core with the modules they need and ran the browse tests. I did not run the full root build. The component JSON and its catalog copy change for the filter description, and I ran the camel-package plugin goals for the endpoint DSL. The doc page and its catalog copy change too.) # 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]
