Skip to content

CAMEL-25019: camel-quickfix - send InOut replies on the session the request arrived on - #26886

Open
oscerd wants to merge 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-25019
Open

oscerd wants to merge 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-25019

Conversation

@oscerd

@oscerd oscerd commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Summary

CAMEL-25019

With exchangePattern=InOut, QuickfixjConsumer chose the session for the reply by reading the SessionID header when the route completed. Any step in the route that set or replaced that header therefore changed which session received the reply. The consumer now captures the session the request arrived on before it hands the exchange to the route, and sends the reply there.

This keeps the intent of CAMEL-5979. That change stopped rebuilding the reply's session ID from the message's CompID fields and used the engine's own SessionID instead, so replies still find the session when SenderSubID/TargetSubID vary. The value used here is the same one the consumer puts in the header; it is now read before routing instead of after.

Changes

  • QuickfixjConsumer: read the SessionID before processing and pass it to sendOutMessage, instead of reading the header again afterwards. No public API change.
  • QuickfixjConsumerTest (new): the reply goes to the originating session, including when the route changes the SessionID header. The component has had no consumer test since QuickfixjConsumerTest was removed in CAMEL-16222.
  • quickfix-component.adoc: the Usage section called DataDictionary a header, but QuickfixjConverters reads it from an exchange property; the wording is corrected. The InOut consumer section now says which session receives the reply.
  • Upgrade guide 4.23: note for routes that changed the header to send the reply to another session.

Testing

  • components/camel-quickfix: all 43 tests pass. The new replyIgnoresSessionIdHeaderChangedDuringRouting fails without the fix.
  • Full reactor mvn clean install -DskipTests -DskipITs: BUILD SUCCESS. The only regenerated file is the catalog copy of quickfix-component.adoc, which is included.

Backports to camel-4.22.x and camel-4.18.x will follow once this is merged.

Claude Code on behalf of oscerd

🤖 Generated with Claude Code

@oscerd
oscerd requested review from davsclaus and gnodet September 25, 2026 08:59
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean fix. The session capture before routing is the right approach — minimal change, preserves the CAMEL-5979 intent, and the test directly proves the regression. Doc correction (header → exchange property) is accurate.

Milestone 4.23.0 is not set.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-quickfix
  • docs

🔬 Scalpel shadow comparison — Scalpel: 9 of 695 tested, 25 compile-only — current: 9 all tested

Maveniverse Scalpel detected 9 affected modules (current approach: 9).

Skip-tests mode would test 9 modules (3 direct + 8 downstream), skip tests for 25 (generated code, meta-modules)

Modules Scalpel would test (9)
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-route-parser ← downstream of org.apache.camel:camel-route-parser
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-yaml-dsl-validator
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
  • camel-quickfix ← components/camel-quickfix/src/main/docs/quickfix-component.adoc, components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java, components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConsumerTest.java
  • camel-yaml-dsl-validator ← downstream of org.apache.camel:camel-catalog
  • camel-yaml-dsl-validator-maven-plugin ← downstream of org.apache.camel:camel-yaml-dsl-validator
Modules with tests skipped (25)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (36 modules, 5m 30s total)

Total reactor time: 5m 30s

Module Duration Status
Camel :: Launcher 51.7s SUCCESS
Camel :: JBang :: MCP 40.5s SUCCESS
Camel :: JBang :: Plugin :: TUI 31.5s SUCCESS
Camel :: Catalog :: Camel Catalog 23.0s SUCCESS
Camel :: QuickFIX/J 21.2s SUCCESS
Camel :: Component DSL 20.6s SUCCESS
Camel :: YAML DSL 18.6s SUCCESS
Camel :: Docs 15.3s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 14.4s SUCCESS
Camel :: Kamelet Main 10.7s SUCCESS
Camel :: YAML DSL :: Validator 10.5s SUCCESS
Camel :: YAML DSL :: Deserializers 8.8s SUCCESS
Camel :: Catalog :: Camel Report Maven Plugin 8.5s SUCCESS
Camel :: Catalog :: Camel Route Parser 8.4s SUCCESS
Camel :: JBang :: Plugin :: Testing 7.4s SUCCESS
Camel :: YAML DSL :: Validator Maven Plugin 6.5s SUCCESS
Camel :: All Components Sync point 5.2s SUCCESS
Camel :: JBang :: Plugin :: Validate 4.9s SUCCESS
Camel :: YAML DSL :: Maven Plugins 3.8s SUCCESS
Camel :: Catalog :: Maven 2.4s SUCCESS
Camel :: Catalog :: Suggest (deprecated) 2.4s SUCCESS
Camel :: Coverage 1.7s SUCCESS
Camel :: JBang :: Plugin :: Edit 1.7s SUCCESS
Camel :: Assembly 1.4s SUCCESS
Camel :: Catalog :: Console 1.3s SUCCESS
Camel :: Catalog :: Dummy Component 1.3s SUCCESS
Camel :: JBang :: Integration tests 1.1s SUCCESS
Camel :: JBang :: Main 1.1s SUCCESS
Camel :: Endpoint DSL :: Support 1.0s SUCCESS
Camel :: JBang :: Plugin :: Generate 1.0s SUCCESS
Camel :: Launcher :: Container 0.7s SUCCESS
Camel :: JBang :: Plugin :: MCP 0.6s SUCCESS
Camel :: JBang :: Plugin :: Route Parser 0.5s SUCCESS
Camel :: Endpoint DSL n/a
Camel :: Integration Tests n/a
Camel :: JBang :: Core n/a

Top 20 slowest modules:

  • Camel :: Launcher (51.7s)
  • Camel :: JBang :: MCP (40.5s)
  • Camel :: JBang :: Plugin :: TUI (31.5s)
  • Camel :: Catalog :: Camel Catalog (23.0s)
  • Camel :: QuickFIX/J (21.2s)
  • Camel :: Component DSL (20.6s)
  • Camel :: YAML DSL (18.6s)
  • Camel :: Docs (15.3s)
  • Camel :: JBang :: Plugin :: Kubernetes (14.4s)
  • Camel :: Kamelet Main (10.7s)
  • Camel :: YAML DSL :: Validator (10.5s)
  • Camel :: YAML DSL :: Deserializers (8.8s)
  • Camel :: Catalog :: Camel Report Maven Plugin (8.5s)
  • Camel :: Catalog :: Camel Route Parser (8.4s)
  • Camel :: JBang :: Plugin :: Testing (7.4s)
  • Camel :: YAML DSL :: Validator Maven Plugin (6.5s)
  • Camel :: All Components Sync point (5.2s)
  • Camel :: JBang :: Plugin :: Validate (4.9s)
  • Camel :: YAML DSL :: Maven Plugins (3.8s)
  • Camel :: Catalog :: Maven (2.4s)

⚙️ View full build and test results

@oscerd oscerd added this to the 4.23.0 milestone Sep 25, 2026

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @oscerd, this looks good. Capturing the SessionID before routing, and keeping it in a local variable rather than an exchange property as the JIRA first suggested, means nothing in the route can redirect the reply. It still keeps the CAMEL-5979 intent of using the engine's own SessionID rather than one rebuilt from CompIDs. I checked the DataDictionary docs fix against QuickfixjConverters.getDataDictionary() and it is accurate: property first (instance or resource name), then the session's dictionary. The new tests follow the module's existing Hamcrest style, and bringing back a consumer test after CAMEL-16222 is a nice bonus. The upgrade-guide note is clear.

This review was generated by an AI agent on behalf of davsclaus and may contain inaccuracies. Please verify all suggestions before applying.

@davsclaus davsclaus added the bug Something isn't working label Sep 28, 2026
@davsclaus

Copy link
Copy Markdown
Contributor

Thanks @oscerd, this is approved and ready, but it now conflicts with main in camel-4x-upgrade-guide-4_23.adoc after several other PRs added upgrade-guide sections today. Could you rebase onto main? I'll merge it once it's clean.

Claude Code on behalf of davsclaus

@gnodet

gnodet commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

🔄 Backport Bot

This bugfix targets main and may need porting to:

  • camel-4.22.x

Add a port/<branch> label to automatically create a backport PR for that branch.

Backport PRs will be created automatically on merge (once a port label is added). Comment /port to create them immediately.

ℹ️ If you push additional commits after /port, use /port again to update the port PRs.

@davsclaus

Copy link
Copy Markdown
Contributor

@oscerd LGTM and ready to merge, but it now conflicts in camel-4x-upgrade-guide-4_23.adoc after today's merges on main. Could you rebase? I'll merge once it is green.

Claude Code on behalf of davsclaus

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase is clean — diff is identical to the previously approved version, upgrade-guide conflict resolved. CI pending on the new commit.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@oscerd
oscerd requested a review from davsclaus September 28, 2026 16:41
…equest arrived on

The InOut consumer read the SessionID header after routing to choose the
session for the reply, so a route that changed the header also changed
where the reply went. Capture the session before routing instead. It is
still the engine's own SessionID, as introduced by CAMEL-5979.

Also correct the docs, which called the DataDictionary exchange property
a header, and add an upgrade-guide note.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants