You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2011/08/13 10:48:27 UTC

[jira] [Resolved] (CAMEL-4329) Username/password ignored when connectionFactory is set in JMS component

     [ https://issues.apache.org/jira/browse/CAMEL-4329?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-4329.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.9.0
                   2.8.1

Thanks for the detailed report

> Username/password ignored when connectionFactory is set in JMS component
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-4329
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4329
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jms
>    Affects Versions: 2.8.0
>         Environment: irrelevant
>            Reporter: Sergey Zolotaryov
>            Assignee: Claus Ibsen
>             Fix For: 2.8.1, 2.9.0
>
>
> There is a conflict between 2 properties: connectionFactory and username/password. If I set both the connectionFactory wins and jms endpoint uses connection factory that is unaware of username/password specified for the endpoint. 
> We need to use both - we have different systems and use different connections factories with different username/passwords.
> Let's assume I have a setup with 2 connection factories jmsConnectionFactory1 and jmsConnectionFactory2 and an endpoint jms:queue:myQueue?connectionFactory=jmsConnectionFactory2&username=myuser&password=secret, here is what happens:
> I see that in JmsComponent:133 you retrieve the first ConnectionFactory (jmsConnectionFactory1) found in Spring.
> Then in JmsComponent:414 you create a delegating ConnectionFactory which always uses username/password (with jmsConnectionFactory1) and set it to the endpoint.
> Then in JmsComponent:434 you finally set the right ConnectionFactory (jmsConnectionFactory2) to the endpoint, though the username/password are lost forever.
> I have solved it for our project by implementing a clone of JmsComponent with overriden createEndpoint. Move line 434 [setProperties(endpoint.getConfiguration(), parameters);] a the line immediately after 407 [String password = getAndRemoveParameter(parameters, "password", String.class);]

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira