Hello everyone,
I am trying to connect to a remote Oracle AQ broker. I have something that looks like this:
Later I have to specify the username and password. My question is whether the following way of doing it is correct:Code:<bean id="connectionFactoryOracleAQ" class="oracle.jms.AQjmsFactory" factory-method="getQueueConnectionFactory"> <constructor-arg index="0"> <value>host</value> </constructor-arg> <constructor-arg index="1" type="java.lang.String"> <value>db-id</value> </constructor-arg> <constructor-arg index="2" type="int"> <value>1521</value> </constructor-arg> <constructor-arg index="3"> <value>thin</value> </constructor-arg> </bean>
I basically want to read from a remote queue, say TEST and then just put what I read on an internal queue.Code:<bean id="jmsConnector" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter"> <property name="targetConnectionFactory"> <ref bean="connectionFactoryOracleAQ"/> </property> <property name="username"> <value>myUsername</value> </property> <property name="password"> <value>myPassword</value> </property> </bean>
I succeeded doing that with a remote Acive MQ broker. I declared a camel context and did the routing with camel.
As you can see by saying jms:TEST, my application looks to read from a queue TEST on the remote active MQ broker defined by the "jms" bean.Code:<bean id="jms" class="org.apache.camel.component.jms.JmsComponent"> <property name="connectionFactory"> <bean class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL" value="tcp://host:port"/> </bean> </property> </bean> <camelContext id="camel" xmlns="activemq.apache.org/camel/schema/spring"> <route> <from uri="jms:TEST"/> <to uri="activemq:internalQUEUE"/> </route> </camelContext>
I could do the same in this case, but the problem happens when I need to pass the password and the username.
Is there any spring virtuoso that can help me with this ?


Reply With Quote
