Add possibility to override LRAClient & LRARoutes#10498
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 If necessary Apache Camel Committers may access logs and test results in the job summaries! |
Components test results:
|
|
🚫 There are (likely) no changes in core core to be tested in this PR |
zhfeng
left a comment
There was a problem hiding this comment.
Thanks @johbossle - I can understand the changes with LRAClient but why do you need to add the extra routes in LRASagaRoutes?
IIRC the rest configurations and direct:lra-compensation and direct:lra-completion in
LRASagaRoutes are very important. If we override LRASagaRoutes and miss these routes in some cases, the LRA can not run correctly.
So can we think about avoiding miss these core routes?
And yeah, we should have these changes on main too.
|
@zhfeng For me, there were two reasons to allow the override of LRARoutes:
To continue, I do see now the following possibilities:
What way should we follow? |
|
From my own point of view, Also +1 for override |
|
Then let us keep the LRARoutes internal and kick it out of the PR. Should I open a new PR for only allowing to override the LRAClient? |
|
Yeah, that would be nice to have a new PR and definely a JIRA ticket is needed. |
|
As agreed we will close this PR and open a new one, containing the agreed changes. |
Configuring JAX-RS to use SSL is done at the server level (WildFly, Quarkus or wherever you're deploying your JAX-RS resources to), ie the coordinator doesn't have to do anything special (it uses jakarta.ws.rs.client.ClientBuilder.newClient() which is supplied by the JAX-RS server). |
|
Thanks @mmusgrov for the clarifying - Is there any example or document about these server configuration? I think it could be very helpful. |
Description
The Saga EIP pattern is using rest based communication for interaction with the lra-coordinator (e.g. narayana). Although there are ways to secure the communication with the coordinator, this is not supported by the underlying code. Also, it is not possible to easily override some implementations, since they are created by intenral constructors.
This change is targeting, that one can override (influence) the creation of the LRAClient and LRASagaRoutes in the LRASagaService. With those "extensions", it is then possible to override some default behavior and for example you can set the HttpClient and use your own adjusted instance with an Authenticator.
Target
camel-3.x, whereas Camel 4 uses themainbranch)Tracking
If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).I do consider this change as a small change, since the default behavior is not touched.
Apache Camel coding standards and style
I checked that each commit in the pull request has a meaningful subject line and body.
I have run
mvn clean install -DskipTestslocally and I have committed all auto-generated changes