[ 
https://issues.apache.org/jira/browse/CAMEL-24637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18139669#comment-18139669
 ] 

Federico Mariani commented on CAMEL-24637:
------------------------------------------

[~kkrawczyk] a note in case it matters for this issue. CAMEL-26692 
(https://github.com/apache/camel/pull/29340) changes what 
{{JmsComponent#createEndpoint}} does with the {{username}} and {{password}}.

Before, every endpoint got a {{UserCredentialsConnectionFactoryAdapter}} of its 
own. Spring finds the session of a transaction by the connection factory 
instance, so a message sent from a transacted route with credentials was 
committed at once.

Now the endpoints that wrap the component's connection factory with the same 
username and password share one adapter. That adapter is kept in a cache on the 
component, at most one entry per username, and is still never set on the 
component configuration.

What this means for this issue:
* The property your analysis relies on still holds. Endpoints created with 
newly resolved credentials, for example after the routes are rebuilt with a 
rotated password, get a new adapter. An adapter is never reused for other 
credentials, and when the component is recreated the cache is new.
* If this issue ends up updating an adapter in place instead, every endpoint 
that shares it changes together. That is probably what a rotation wants, but it 
is now one change for several endpoints rather than one per endpoint.

_Claude Code on behalf of Federico Mariani_

> camel-jms: implement SecretRotationAware to re-authenticate on secret rotation
> ------------------------------------------------------------------------------
>
>                 Key: CAMEL-24637
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24637
>             Project: Camel
>          Issue Type: Sub-task
>          Components: camel-jms
>            Reporter: Andrea Cosentino
>            Assignee: Karol Krawczyk
>            Priority: Major
>
> Sub-task of CAMEL-24636.
> Adopt the {{SecretRotationAware}} SPI in camel-jms.
> {{JmsComponent#setUsername}} and {{setPassword}} delegate to a shared 
> {{JmsConfiguration}}, whose values are resolved from property placeholders 
> once at configure time. The {{ConnectionFactory}} itself is normally a 
> registry bean (often a pooled one) created at bootstrap with the credentials 
> valid at that moment.
> Neither is refreshed by {{RouteController.reloadAllRoutes()}}, so after a 
> secret rotation the component keeps presenting the old credentials.
> On {{onSecretRotation}} the component should re-resolve its configured 
> username and password and re-authenticate the connection factory in place, 
> closing and re-establishing pooled connections as needed.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to