You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by selezovikj <se...@gmail.com> on 2008/10/07 16:56:58 UTC
Camel and Oracle AQ
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 ?
--
View this message in context: http://www.nabble.com/Camel-and-Oracle-AQ-tp19860058s22882p19860058.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel and Oracle AQ
Posted by selezovikj <se...@gmail.com>.
It works now. There were more consumers, so I had to wait a little longer to
receive a message.
I owe you a beer :-D
selezovikj wrote:
>
> There are messages to consume on the AQ for sure.
> The funny thing is that I don't see any information about whether it is
> actually connecting to the IP address I am giving,
> and whether it accepts the username and password.
> I tried connecting to a remote Active MQ broker, it is successful and I
> receive DEBUG information that I am connected to the remote host and port
> number.
>
>
>
>
> James.Strachan wrote:
>>
>> 2008/10/9 selezovikj <se...@gmail.com>:
>>> When I try to connect, I don't see any logging information on connecting
>>> to
>>> the remote oracle AQ component.
>>> This is what I get:
>>>
>>> Consumer [oracle.jms.AQjmsConsumer@c736e4] of session
>>> [oracle.jms.AQjmsSession@952905] did not receive a message
>>>
>>> ...
>>>
>>> And the list goes on. It seems that my app keeps on polling the remote
>>> Oracle AQ broker.
>>
>> Yes - there are different Spring MessageListenerContainer
>> implementations you can use.
>>
>> Are there messages on the AQ to consume?
>>
>>
>>> I am also wondering why when I am injecting to the JmsComponent do I
>>> refer
>>> to the credentials bean for the connectionFactory property, even though
>>> "credentials" is not a connectionFactory ?
>>
>> Yes it is - see the javadoc; its a delegate/decorator.
>> 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-tp19860058s22882p19899520.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel and Oracle AQ
Posted by James Strachan <ja...@gmail.com>.
2008/10/9 selezovikj <se...@gmail.com>:
>
> There are messages to consume on the AQ for sure.
> The funny thing is that I don't see any information about whether it is
> actually connecting to the IP address I am giving,
> and whether it accepts the username and password.
> I tried connecting to a remote Active MQ broker, it is successful and I
> receive DEBUG information that I am connected to the remote host and port
> number.
Does the AQ client support any logging? Have you tried turning on all
debug logging?
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com
Re: Camel and Oracle AQ
Posted by selezovikj <se...@gmail.com>.
There are messages to consume on the AQ for sure.
The funny thing is that I don't see any information about whether it is
actually connecting to the IP address I am giving,
and whether it accepts the username and password.
I tried connecting to a remote Active MQ broker, it is successful and I
receive DEBUG information that I am connected to the remote host and port
number.
James.Strachan wrote:
>
> 2008/10/9 selezovikj <se...@gmail.com>:
>> When I try to connect, I don't see any logging information on connecting
>> to
>> the remote oracle AQ component.
>> This is what I get:
>>
>> Consumer [oracle.jms.AQjmsConsumer@c736e4] of session
>> [oracle.jms.AQjmsSession@952905] did not receive a message
>>
>> ...
>>
>> And the list goes on. It seems that my app keeps on polling the remote
>> Oracle AQ broker.
>
> Yes - there are different Spring MessageListenerContainer
> implementations you can use.
>
> Are there messages on the AQ to consume?
>
>
>> I am also wondering why when I am injecting to the JmsComponent do I
>> refer
>> to the credentials bean for the connectionFactory property, even though
>> "credentials" is not a connectionFactory ?
>
> Yes it is - see the javadoc; its a delegate/decorator.
> 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-tp19860058s22882p19899281.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel and Oracle AQ
Posted by James Strachan <ja...@gmail.com>.
2008/10/9 selezovikj <se...@gmail.com>:
> When I try to connect, I don't see any logging information on connecting to
> the remote oracle AQ component.
> This is what I get:
>
> Consumer [oracle.jms.AQjmsConsumer@c736e4] of session
> [oracle.jms.AQjmsSession@952905] did not receive a message
>
> ...
>
> And the list goes on. It seems that my app keeps on polling the remote
> Oracle AQ broker.
Yes - there are different Spring MessageListenerContainer
implementations you can use.
Are there messages on the AQ to consume?
> I am also wondering why when I am injecting to the JmsComponent do I refer
> to the credentials bean for the connectionFactory property, even though
> "credentials" is not a connectionFactory ?
Yes it is - see the javadoc; its a delegate/decorator.
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
Re: Camel and Oracle AQ
Posted by selezovikj <se...@gmail.com>.
When I try to connect, I don't see any logging information on connecting to
the remote oracle AQ component.
This is what I get:
Consumer [oracle.jms.AQjmsConsumer@c736e4] of session
[oracle.jms.AQjmsSession@952905] did not receive a message
...
And the list goes on. It seems that my app keeps on polling the remote
Oracle AQ broker.
I am also wondering why when I am injecting to the JmsComponent do I refer
to the credentials bean for the connectionFactory property, even though
"credentials" is not a connectionFactory ?
And maybe I should be injecting into an OracleAQ component instead of a
JmsComponent ?
<bean id="credentials"
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory">
<ref bean="connectionFactoryOracleAQ"/>
</property>
<property name="username">
<value>awht</value>
</property>
<property name="password">
<value>awht</value>
</property>
</bean>
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory" ref="credentials"/>
</bean>
James.Strachan wrote:
>
> 2008/10/8 selezovikj <se...@gmail.com>:
>>
>> So, this should be my final version:
>>
>> <bean id="credentials"
>>
>> class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
>> <property name="targetConnectionFactory">
>> <ref bean="connectionFactoryOracleAQ"/>
>> </property>
>> <property name="username">
>> <value>USER</value>
>> </property>
>> <property name="password">
>> <value>PASS</value>
>> </property>
>> </bean>
>>
>> <bean id="jms2" class="org.apache.camel.component.jms.JmsComponent">
>> <property name="connectionFactory">
>> <inject bean="credentials"/>
>> </property>
>
> change the above to
>
> <property name="connectionFactory" ref="credentials"/>
>
>
>
> --
> 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-tp19860058s22882p19898307.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel and Oracle AQ
Posted by James Strachan <ja...@gmail.com>.
2008/10/8 selezovikj <se...@gmail.com>:
>
> So, this should be my final version:
>
> <bean id="credentials"
>
> class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
> <property name="targetConnectionFactory">
> <ref bean="connectionFactoryOracleAQ"/>
> </property>
> <property name="username">
> <value>USER</value>
> </property>
> <property name="password">
> <value>PASS</value>
> </property>
> </bean>
>
> <bean id="jms2" class="org.apache.camel.component.jms.JmsComponent">
> <property name="connectionFactory">
> <inject bean="credentials"/>
> </property>
change the above to
<property name="connectionFactory" ref="credentials"/>
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com
Re: Camel and Oracle AQ
Posted by selezovikj <se...@gmail.com>.
So, this should be my final version:
<bean id="credentials"
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory">
<ref bean="connectionFactoryOracleAQ"/>
</property>
<property name="username">
<value>USER</value>
</property>
<property name="password">
<value>PASS</value>
</property>
</bean>
<bean id="jms2" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<inject bean="credentials"/>
</property>
</bean>
If this is not right, can you please help me out with a link on how to use
"inject".
James.Strachan wrote:
>
> You need to also inject the jms2 bean into the JmsComponet though
>
> 2008/10/7 selezovikj <se...@gmail.com>:
>>
>> 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 <se...@gmail.com>:
>>>>
>>>> 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
>
>
--
View this message in context: http://www.nabble.com/Camel-and-Oracle-AQ-tp19860058s22882p19874480.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel and Oracle AQ
Posted by James Strachan <ja...@gmail.com>.
You need to also inject the jms2 bean into the JmsComponet though
2008/10/7 selezovikj <se...@gmail.com>:
>
> 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 <se...@gmail.com>:
>>>
>>> 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
Re: Camel and Oracle AQ
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
This is a cross post and is being discussed at the ServiceMix user mailing list.
On Sat, May 15, 2010 at 3:37 AM, kkashi <kk...@gmail.com> wrote:
>
> Hello,
>
> Saw your message here on the forum. Is this working for you? Did you deploy
> this into OSGi container? I have problem deploying into smx and I get an
> following error message:
>
> The bundle could not be resolved. Reason: Missing Constraint:
> Import-Package: oracle.jms; version="0.0.0"
>
> Appreciate your input.
>
> Thanks.
>
>
>
> selezovikj wrote:
>>
>> 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 <se...@gmail.com>:
>>>>
>>>> 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://old.nabble.com/Camel-and-Oracle-AQ-tp19860058p28565688.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>
--
Claus Ibsen
Apache Camel Committer
Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Re: Camel and Oracle AQ
Posted by kkashi <kk...@gmail.com>.
Hello,
Saw your message here on the forum. Is this working for you? Did you deploy
this into OSGi container? I have problem deploying into smx and I get an
following error message:
The bundle could not be resolved. Reason: Missing Constraint:
Import-Package: oracle.jms; version="0.0.0"
Appreciate your input.
Thanks.
selezovikj wrote:
>
> 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 <se...@gmail.com>:
>>>
>>> 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://old.nabble.com/Camel-and-Oracle-AQ-tp19860058p28565688.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
Re: Camel and Oracle AQ
Posted by selezovikj <se...@gmail.com>.
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 <se...@gmail.com>:
>>
>> 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.
Re: Camel and Oracle AQ
Posted by James Strachan <ja...@gmail.com>.
2008/10/7 selezovikj <se...@gmail.com>:
>
> 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