You need to also inject the jms2 bean into the JmsComponet though 2008/10/7 selezovikj <[EMAIL PROTECTED]>: > > I know that, but I don't seem to be able do it in spring the right way. > What I am doing is this: > > <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> > > <bean id="jms2" > > 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> > > And then I guess the camel routing should be like this: > > <camelContext id="camel" > xmlns="activemq.apache.org/camel/schema/spring"> > <route> > <from uri="jms2:TEST"/> > <to uri="activemq:internalQUEUE"/> > </route> > </camelContext> > > Any help with this ? > > > James.Strachan wrote: >> >> 2008/10/7 selezovikj <[EMAIL PROTECTED]>: >>> >>> Hello everyone, >>> >>> I want to connect to a remote Oracle AQ broker and read from a queue. >>> I am doing all my configuration in a spring config file, and this is what >>> I >>> have done so far: >>> >>> <bean id="jms2" class="org.apache.camel.component.jms.JmsComponent"> >>> <property name="connectionFactory"> >>> <bean 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> >>> </property> >>> </bean> >>> >>> >>> Later, I declare a camel context and declare the routing in the same >>> config >>> file: >>> >>> <camelContext id="camel" >>> xmlns="http://activemq.apache.org/camel/schema/spring"> >>> <route> >>> <from uri="jms2:remoteQUEUE"/> >>> <to uri="activemq:internalQUEUE"/> >>> </route> >>> </camelContext> >>> >>> So my question is how do I set the username and password in order to >>> connect >>> to the remote Oracle AQ broker ? >> >> You typically set the username/pwd on the ConnectionFactory. If one is >> not available on your JMS provider then Spring has a helper wrapper >> class... >> >> http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/jms/connection/UserCredentialsConnectionFactoryAdapter.html >> -- >> James >> ------- >> http://macstrac.blogspot.com/ >> >> Open Source Integration >> http://open.iona.com >> >> > > -- > View this message in context: > http://www.nabble.com/Camel-and-Oracle-AQ-tp19860058s22882p19861101.html > Sent from the Camel - Users mailing list archive at Nabble.com. > >
-- James ------- http://macstrac.blogspot.com/ Open Source Integration http://open.iona.com
