Skip to content

Conversation

@brunovg
Copy link
Contributor

@brunovg brunovg commented Oct 21, 2025

Description

This Pull Request addresses a major architectural limitation in the camel-as2 component where multiple inbound AS2 Consumers (routes) could not share the same port number.

The previous architecture led to two primary issues:

Port Binding Failure: The second route attempting to start would fail with an "Address already in use" error.

Configuration Collision: Even if the port binding was bypassed, encrypted messages failed with a NullPointerException or AS2DecryptionException because the shared server connection's cryptographic keys were overwritten or set to null and could not be retrieved by the correct Consumer.

CAMEL-22557: camel-as2 - Server-side DecryptingPrivateKey Conflict: Key from first route started is enforced for all subsequent routes on the same serverPortNumber

@Croway
Copy link
Contributor

Croway commented Oct 21, 2025

Thanks for the contribution @brunovg , could you add a test that shows this improvement?

@github-actions
Copy link
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.

  • You can label PRs using build-all, build-dependents, 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.

@claudio4j
Copy link
Contributor

Thanks for the contribution!
Specifically the tests for the new parameter requestUriPattern are important and thise use case to have different decryptingPrivateKey for the servers listening on the same port.
I ran mvn -ntp verify -f components/camel-as2/ and there are many failures, try mvn install -Psourcecheck -DskipTests -f components/camel-as2/ also.
These changes should go first to main branch, then after merge to backport to the 4.10 and 4.14 branches.
I'm going to review the design changes.

Copy link
Contributor

@orpiske orpiske left a comment

Choose a reason for hiding this comment

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

Thanks, it looks like a great feature improvement! There's a few things that need to be adjusted, though (including tests, as reported).

@claudio4j
Copy link
Contributor

The CI reports failures for the camel-catalog and endpointdsl, you can regenerate the as2 files with mvn install -DskipTests -pl :camel-endpointdsl,:camel-catalog

@davsclaus davsclaus force-pushed the feature/as2-port-sharing-fix branch from 79580ca to 41a76dd Compare October 23, 2025 15:42
@davsclaus davsclaus force-pushed the feature/as2-port-sharing-fix branch from 41a76dd to 4014d98 Compare October 24, 2025 13:10
…l AS2 configuration fields instead of null to prevent existing unit tests from failing.
…l AS2 configuration fields instead of null to prevent existing unit tests from failing.
…he actual AS2 configuration fields instead of null to prevent existing unit tests from failing."

This reverts commit eb4b3ee, reversing
changes made to 660e170.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants