camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lsclark <lisa.cl...@rackspace.com>
Subject How to set user/password on connection created from JNDI lookup ConnectionFactory
Date Mon, 23 Jun 2008 21:47:44 GMT

I am attempting to create a durable subscription to a topic on a JBoss
Messaging broker.  I have a JMSComponent configured via spring and am using
this component as an endpoint in a route.  I am looking up the
ConnectionFactory via JNDI.

What I can't figure out how to do is the configuration in camel for passing
in a username and password to be used by the connection factory when it
obtains a connection.  I have tried a number of things, and searched around
a bit, but haven't found anyone that has run into this particular issue. 
The current configuration produces the exception: 


 ERROR [org.springframework.jms.listener.DefaultMessageListenerContainer]
Setup of JMS message listener invoker failed - trying to recover
Logger=org.springframework.jms.listener.DefaultMessageListenerContainer
javax.jms.JMSSecurityException: User: null is not authorized to create
durable sub on destination testTopic


Any help or leads would be appreciated!


Spring configuration:

<bean id="jmsProvider" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory" ref="jmsConnectionFactory" />
    <property name="destinationResolver" ref="jmsDestinationResolver" />
    <property name="deliveryPersistent" value="true" />
    <property name="timeToLive" value="0" />
    <property name="clientId" value="DurableSubscriberExample" />       
</bean>
    
<bean id="jmsDestinationResolver"
class="org.springframework.jms.support.destination.JndiDestinationResolver">
    <property name="jndiTemplate" ref="jndiTemplate" />
    <property name="cache" value="true" />
</bean>

<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
        <props>
            <prop
key="java.naming.factory.initial">${jms.jndiContextFactory}</prop>
            <prop key="brokerURL">${jms.jndiProviderUrl}</prop>
            <prop
key="java.naming.provider.url">${jms.jndiProviderUrl}</prop>
	</props>
    </property>
</bean>
    
<bean id="jmsConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiTemplate" ref="jndiTemplate" />
    <property name="jndiName">
            <value>${jms.connectionFactoryName}</value>
    </property>
</bean>
    
<bean id="testProcessor" class="com.test.TestProcessor"/>


Route DSL:

from("jmsProvider:topic:/topic/testTopic?durableSubscriptionName=john,clientId=DurableSubscriberExample")
            .to("bean:testProcessor");
-- 
View this message in context: http://www.nabble.com/How-to-set-user-password-on-connection-created-from-JNDI-lookup-ConnectionFactory-tp18079250s22882p18079250.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message