Repository navigation
Conversation
…port use their own asynchronous MDN settings
gnodet-bot
left a comment
There was a problem hiding this comment.
The backport cherry-picked the AS2ServerConnection call site that passes sslContext to a 10-arg AS2AsynchronousMDNManager constructor — but that constructor only exists on main. On camel-4.22.x the class has only 8-arg (deprecated) and 9-arg constructors, neither of which accepts an SSLContext. This is a compilation error.
The core logic of the fix — moving MDN settings from AS2ServerConnection fields into AS2ConsumerConfiguration and looking them up per-request — is correct and well-structured. The integration test (AS2ServerTwoConsumerAsyncMdnSettingsTest) covers the exact multi-consumer scenario; the unit test (AS2ConsumerConfigurationMdnSettingsTest) validates fallback behavior; the migration guide is thorough. The only blocker is the incomplete backport: the AS2AsynchronousMDNManager 10-arg constructor from main was not carried over.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
| private final String password; | ||
| private final String accessToken; | ||
| private final String asyncMdnAllowedHosts; | ||
| private final SSLContext sslContext; |
There was a problem hiding this comment.
⛔ Compilation error (root cause): AS2AsynchronousMDNManager has no 10-arg constructor on camel-4.22.x.
The original commit on main rewrote AS2AsynchronousMDNManager to add a 10-arg constructor accepting SSLContext. That file change was silently dropped during the backport cherry-pick. On camel-4.22.x, only these constructors exist:
- 8-arg (deprecated):
(as2Version, userAgent, senderFQDN, signingCertChain, signingKey, userName, password, accessToken) - 9-arg: adds
allowedHosts
Neither accepts SSLContext. The private final SSLContext sslContext field added here feeds only the non-existent 10-arg call — once that call is fixed to use the 9-arg constructor, this field is unused and must be removed.
On this branch AS2AsynchronousMDNManager explicitly refuses https delivery (throw new HttpException("TLS delivery of asynchronous MDNs is not supported")), so the parameter serves no purpose here.
| private final SSLContext sslContext; |
| AS2AsynchronousMDNManager asynchronousMDNManager = new AS2AsynchronousMDNManager( | ||
| AS2ServerConnection.this.as2Version, | ||
| AS2ServerConnection.this.originServer, | ||
| AS2ServerConnection.this.serverFqdn, | ||
| config.getSigningCertificateChain(), | ||
| config.getSigningPrivateKey(), | ||
| config.getMdnUserName(), | ||
| config.getMdnPassword(), | ||
| config.getMdnAccessToken(), | ||
| config.getAsyncMdnAllowedHosts(), | ||
| AS2ServerConnection.this.sslContext); |
There was a problem hiding this comment.
⛔ Compilation error: passing sslContext as the 10th argument — this constructor doesn't exist on camel-4.22.x.
Drop the sslContext argument and use the existing 9-arg constructor:
| AS2AsynchronousMDNManager asynchronousMDNManager = new AS2AsynchronousMDNManager( | |
| AS2ServerConnection.this.as2Version, | |
| AS2ServerConnection.this.originServer, | |
| AS2ServerConnection.this.serverFqdn, | |
| config.getSigningCertificateChain(), | |
| config.getSigningPrivateKey(), | |
| config.getMdnUserName(), | |
| config.getMdnPassword(), | |
| config.getMdnAccessToken(), | |
| config.getAsyncMdnAllowedHosts(), | |
| AS2ServerConnection.this.sslContext); | |
| AS2AsynchronousMDNManager asynchronousMDNManager = new AS2AsynchronousMDNManager( | |
| AS2ServerConnection.this.as2Version, | |
| AS2ServerConnection.this.originServer, | |
| AS2ServerConnection.this.serverFqdn, | |
| config.getSigningCertificateChain(), | |
| config.getSigningPrivateKey(), | |
| config.getMdnUserName(), | |
| config.getMdnPassword(), | |
| config.getMdnAccessToken(), | |
| config.getAsyncMdnAllowedHosts()); |
| String asyncMdnAllowedHosts) | ||
| throws IOException { | ||
| this.asyncMdnAllowedHosts = asyncMdnAllowedHosts; | ||
| this.sslContext = sslContext; |
There was a problem hiding this comment.
sslContext field (line 92) and the 10-arg constructor call, this assignment becomes a compilation error too. The sslContext constructor parameter is already passed to RequestAcceptorThread — storing it as a field is unnecessary.
| this.sslContext = sslContext; |
| `mdnAccessToken` and `asyncMdnAllowedHosts`) to the messages received on its own pattern. | ||
|
|
||
| The settings of the shared server connection still come from the first endpoint created on the port: | ||
| `sslContextParameters` and `sslContext` (used for the TLS listener and for the https delivery of asynchronous MDNs), |
There was a problem hiding this comment.
📝 Inaccurate on camel-4.22.x: AS2AsynchronousMDNManager on this branch explicitly refuses https delivery with throw new HttpException("TLS delivery of asynchronous MDNs is not supported"). The claim that sslContext is used "for the https delivery of asynchronous MDNs" is misleading here — it is used for the TLS listener only.
| `sslContextParameters` and `sslContext` (used for the TLS listener and for the https delivery of asynchronous MDNs), | |
| `sslContextParameters` and `sslContext` (used for the TLS listener), |
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
davsclaus
left a comment
There was a problem hiding this comment.
TL;DR
The fix matches #28274, but the branch does not compile, and the conflict resolution brought in code and docs that exist only on main.
Blockers
camel-as2-apidoes not compile:AS2ServerConnection.java:601-611calls a 10-argumentAS2AsynchronousMDNManagerconstructor that camel-4.22.x does not have (CI:[601,68] no suitable constructor found). The four open threads from the automated review (lines 92, 601-611 and 677, andas2-component.adoc:109) describe the fix.
Other findings: 4
Note on the cause: #28274 did not change AS2AsynchronousMDNManager.java. The constructor with SSLContext comes from CAMEL-24474 (#26164), a main-only feature for TLS delivery of asynchronous MDNs. So the fix is to drop the argument, as the inline suggestions do, and not to backport that constructor. For the same reason the new sentence at as2-component.adoc:109 is not true on this branch: here AS2AsynchronousMDNManager refuses https delivery.
Extra docs. as2-component.adoc:59-102 (and the catalog copy) add the whole == Usage section with the YAML example. That section comes from CAMEL-25736 (#28026), which is not on camel-4.22.x. #28274 only adds the two paragraphs after it. Please keep only those two paragraphs, or say in the PR description that the example is included on purpose.
Extra refactoring (optional). AS2ServerConnection.java:559 and 584-637 move the asynchronous MDN code into a new handleAsynchronousMDN method, as on main. The behaviour is the same. The 4.18.x backport (#28348) shows the smaller change: replace the arguments in place.
Upgrade guide section. The note at camel-4x-upgrade-guide-4_22.adoc:2090 is at the end of the file, inside "Upgrading Camel 4.21 to 4.22". The change ships in 4.22.3, so it belongs under "Upgrading from 4.22.2 to 4.22.3" (line 14).
Main sync. The 4.22 guide on main does not have this note yet, and #28274 says the backports add it to the 4.22 and 4.18 guides on main. Please add it there, in the "4.22.2 to 4.22.3" section. The 4.18.6 note can go in the same main PR.
Everything else matches #28274: AS2ConsumerConfiguration, AS2Consumer, AS2Configuration, both new tests, and the generated files. The new tests have not run on this branch yet, because the build stops at the compile error.
Reviewed with Claude Code on behalf of @davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
|
@gnodet friendly ping: this one has a merge conflict, and Claude Code on behalf of davsclaus |
Backport of #28274
Cherry-pick of cb73720 to camel-4.22.x.
Conflicts resolved automatically by backport bot agent.