You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Viswanath Durbha <Vi...@gmail.com> on 2007/11/02 09:33:19 UTC
broker1-->q1 to broker2-->q2
Hi,
I am using activemq 5.0. I have a question regarding forwarding messages
from two pre-configured queues on different broker instances.
Let's say I'm running two brokers broker1 and broker2. broker1 will have a
queue q1 and broker2 will have a queue q2. How do I configure these brokers
so that any message put in broker1-->q1 will be forwarded to broker2-->q2?
Thanks,
Viswanath
--
View this message in context: http://www.nabble.com/broker1--%3Eq1-to-broker2--%3Eq2-tf4736085s2354.html#a13543783
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: broker1-->q1 to broker2-->q2
Posted by Viswanath Durbha <Vi...@gmail.com>.
Hi,
I finally got it to work. The change I did to the xml configuration for
broker1 is that I changed
<property name="brokerURL"
value="tcp://localhost:62001?broker.persistent=false"/>
to
<property name="brokerURL" value="tcp://localhost:62001"/>
It works perfectly fine now once I did this change. I was also able to see
the subscriber in the JMX console once I made this change.
I wonder whether the way I specified the URL is incorrect!! Is that '?'
character causing trouble?
James.Strachan wrote:
>
> On 02/11/2007, Viswanath Durbha <Vi...@gmail.com> wrote:
>>
>> To my surprise, there is no subscriber created in the JMX console for
>> broker1-->q1. May be the way I defined the activemq component in the xml
>> config file isn't correct.
>
> Do you see any conections on broker1 (tcp://localhost.localdomain:62001)
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source SOA
> http://open.iona.com
>
>
--
View this message in context: http://www.nabble.com/broker1--%3Eq1-to-broker2--%3Eq2-tf4736085s2354.html#a13562356
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: broker1-->q1 to broker2-->q2
Posted by James Strachan <ja...@gmail.com>.
On 02/11/2007, Viswanath Durbha <Vi...@gmail.com> wrote:
>
> To my surprise, there is no subscriber created in the JMX console for
> broker1-->q1. May be the way I defined the activemq component in the xml
> config file isn't correct.
Do you see any conections on broker1 (tcp://localhost.localdomain:62001)
--
James
-------
http://macstrac.blogspot.com/
Open Source SOA
http://open.iona.com
Re: broker1-->q1 to broker2-->q2
Posted by Viswanath Durbha <Vi...@gmail.com>.
To my surprise, there is no subscriber created in the JMX console for
broker1-->q1. May be the way I defined the activemq component in the xml
config file isn't correct.
<bean id="broker1"
class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL"
value="tcp://localhost.localdomain:62001?broker.persistent=false"/>
</bean>
</property>
</bean>
Don't have the faintest clue what's wrong with the above definition of
activemq component.
Viswanath Durbha wrote:
>
> Also the "Number of Consumers" column on the web console for broker1-->1
> remains 0.
>
>
> Viswanath Durbha wrote:
>>
>> I'm using to web consoles for broker1 and broker2 to send and also to see
>> what is happening to the message. The message just stays on broker1-->q1
>> and doesn't go anywhere.
>>
>>
>> James.Strachan wrote:
>>>
>>> It looks fine to me. Do you see the subscriber in the JMX console?
>>> When you send a message to q1 do you see it being consumed from JMX?
>>>
>>> On 02/11/2007, Viswanath Durbha <Vi...@gmail.com> wrote:
>>>>
>>>> Thanks for the super quick reply.
>>>>
>>>> I've done the following configuration to activemq_broker1.xml file.
>>>> I've
>>>> added two activemq components. And then I added a camel route. But it
>>>> doesn't seem to work for me. Am I missing something here?
>>>>
>>>> <bean id="broker1" class="org.apache.camel.component.jms.JmsComponent">
>>>> <property name="connectionFactory">
>>>> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>>>> <property name="brokerURL"
>>>> value="tcp://localhost:62001?broker.persistent=false"/>
>>>> </bean>
>>>> </property>
>>>> </bean>
>>>> <bean id="broker2" class="org.apache.camel.component.jms.JmsComponent">
>>>> <property name="connectionFactory">
>>>> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>>>> <property name="brokerURL"
>>>> value="tcp://localhost:63001?broker.persistent=false"/>
>>>> </bean>
>>>> </property>
>>>> </bean>
>>>> <camelContext id="camel"
>>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>>> <route>
>>>> <from uri="broker1:q1"/>
>>>> <to uri="broker2:q2"/>
>>>> </route>
>>>> </camelContext>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> James.Strachan wrote:
>>>> >
>>>> > On 02/11/2007, Viswanath Durbha <Vi...@gmail.com> wrote:
>>>> >>
>>>> >> Hi,
>>>> >>
>>>> >> I am using activemq 5.0. I have a question regarding forwarding
>>>> messages
>>>> >> from two pre-configured queues on different broker instances.
>>>> >>
>>>> >> Let's say I'm running two brokers broker1 and broker2. broker1 will
>>>> have
>>>> >> a
>>>> >> queue q1 and broker2 will have a queue q2. How do I configure these
>>>> >> brokers
>>>> >> so that any message put in broker1-->q1 will be forwarded to
>>>> >> broker2-->q2?
>>>> >
>>>> > If they are the same queue name you use a network of brokers.
>>>> >
>>>> > If you want to use different queues then using a Camel route is the
>>>> > simplest...
>>>> > http://activemq.apache.org/camel/
>>>> >
>>>> > <route>
>>>> > <from uri="activemq:q1"/>
>>>> > <to uri="remoteBroker:q2"/>
>>>> > </route>
>>>> >
>>>> > --
>>>> > James
>>>> > -------
>>>> > http://macstrac.blogspot.com/
>>>> >
>>>> > Open Source SOA
>>>> > http://open.iona.com
>>>> >
>>>> >
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/broker1--%3Eq1-to-broker2--%3Eq2-tf4736085s2354.html#a13544096
>>>>
>>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> James
>>> -------
>>> http://macstrac.blogspot.com/
>>>
>>> Open Source SOA
>>> http://open.iona.com
>>>
>>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/broker1--%3Eq1-to-broker2--%3Eq2-tf4736085s2354.html#a13545010
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: broker1-->q1 to broker2-->q2
Posted by Viswanath Durbha <Vi...@gmail.com>.
Also the "Number of Consumers" column on the web console for broker1-->1
remains 0.
Viswanath Durbha wrote:
>
> I'm using to web consoles for broker1 and broker2 to send and also to see
> what is happening to the message. The message just stays on broker1-->q1
> and doesn't go anywhere.
>
>
> James.Strachan wrote:
>>
>> It looks fine to me. Do you see the subscriber in the JMX console?
>> When you send a message to q1 do you see it being consumed from JMX?
>>
>> On 02/11/2007, Viswanath Durbha <Vi...@gmail.com> wrote:
>>>
>>> Thanks for the super quick reply.
>>>
>>> I've done the following configuration to activemq_broker1.xml file. I've
>>> added two activemq components. And then I added a camel route. But it
>>> doesn't seem to work for me. Am I missing something here?
>>>
>>> <bean id="broker1" class="org.apache.camel.component.jms.JmsComponent">
>>> <property name="connectionFactory">
>>> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>>> <property name="brokerURL"
>>> value="tcp://localhost:62001?broker.persistent=false"/>
>>> </bean>
>>> </property>
>>> </bean>
>>> <bean id="broker2" class="org.apache.camel.component.jms.JmsComponent">
>>> <property name="connectionFactory">
>>> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>>> <property name="brokerURL"
>>> value="tcp://localhost:63001?broker.persistent=false"/>
>>> </bean>
>>> </property>
>>> </bean>
>>> <camelContext id="camel"
>>> xmlns="http://activemq.apache.org/camel/schema/spring">
>>> <route>
>>> <from uri="broker1:q1"/>
>>> <to uri="broker2:q2"/>
>>> </route>
>>> </camelContext>
>>>
>>>
>>>
>>>
>>>
>>> James.Strachan wrote:
>>> >
>>> > On 02/11/2007, Viswanath Durbha <Vi...@gmail.com> wrote:
>>> >>
>>> >> Hi,
>>> >>
>>> >> I am using activemq 5.0. I have a question regarding forwarding
>>> messages
>>> >> from two pre-configured queues on different broker instances.
>>> >>
>>> >> Let's say I'm running two brokers broker1 and broker2. broker1 will
>>> have
>>> >> a
>>> >> queue q1 and broker2 will have a queue q2. How do I configure these
>>> >> brokers
>>> >> so that any message put in broker1-->q1 will be forwarded to
>>> >> broker2-->q2?
>>> >
>>> > If they are the same queue name you use a network of brokers.
>>> >
>>> > If you want to use different queues then using a Camel route is the
>>> > simplest...
>>> > http://activemq.apache.org/camel/
>>> >
>>> > <route>
>>> > <from uri="activemq:q1"/>
>>> > <to uri="remoteBroker:q2"/>
>>> > </route>
>>> >
>>> > --
>>> > James
>>> > -------
>>> > http://macstrac.blogspot.com/
>>> >
>>> > Open Source SOA
>>> > http://open.iona.com
>>> >
>>> >
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/broker1--%3Eq1-to-broker2--%3Eq2-tf4736085s2354.html#a13544096
>>>
>>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> James
>> -------
>> http://macstrac.blogspot.com/
>>
>> Open Source SOA
>> http://open.iona.com
>>
>>
>
>
--
View this message in context: http://www.nabble.com/broker1--%3Eq1-to-broker2--%3Eq2-tf4736085s2354.html#a13544289
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: broker1-->q1 to broker2-->q2
Posted by Viswanath Durbha <Vi...@gmail.com>.
I'm using to web consoles for broker1 and broker2 to send and also to see
what is happening to the message. The message just stays on broker1-->q1 and
doesn't go anywhere.
James.Strachan wrote:
>
> It looks fine to me. Do you see the subscriber in the JMX console?
> When you send a message to q1 do you see it being consumed from JMX?
>
> On 02/11/2007, Viswanath Durbha <Vi...@gmail.com> wrote:
>>
>> Thanks for the super quick reply.
>>
>> I've done the following configuration to activemq_broker1.xml file. I've
>> added two activemq components. And then I added a camel route. But it
>> doesn't seem to work for me. Am I missing something here?
>>
>> <bean id="broker1" class="org.apache.camel.component.jms.JmsComponent">
>> <property name="connectionFactory">
>> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>> <property name="brokerURL"
>> value="tcp://localhost:62001?broker.persistent=false"/>
>> </bean>
>> </property>
>> </bean>
>> <bean id="broker2" class="org.apache.camel.component.jms.JmsComponent">
>> <property name="connectionFactory">
>> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
>> <property name="brokerURL"
>> value="tcp://localhost:63001?broker.persistent=false"/>
>> </bean>
>> </property>
>> </bean>
>> <camelContext id="camel"
>> xmlns="http://activemq.apache.org/camel/schema/spring">
>> <route>
>> <from uri="broker1:q1"/>
>> <to uri="broker2:q2"/>
>> </route>
>> </camelContext>
>>
>>
>>
>>
>>
>> James.Strachan wrote:
>> >
>> > On 02/11/2007, Viswanath Durbha <Vi...@gmail.com> wrote:
>> >>
>> >> Hi,
>> >>
>> >> I am using activemq 5.0. I have a question regarding forwarding
>> messages
>> >> from two pre-configured queues on different broker instances.
>> >>
>> >> Let's say I'm running two brokers broker1 and broker2. broker1 will
>> have
>> >> a
>> >> queue q1 and broker2 will have a queue q2. How do I configure these
>> >> brokers
>> >> so that any message put in broker1-->q1 will be forwarded to
>> >> broker2-->q2?
>> >
>> > If they are the same queue name you use a network of brokers.
>> >
>> > If you want to use different queues then using a Camel route is the
>> > simplest...
>> > http://activemq.apache.org/camel/
>> >
>> > <route>
>> > <from uri="activemq:q1"/>
>> > <to uri="remoteBroker:q2"/>
>> > </route>
>> >
>> > --
>> > James
>> > -------
>> > http://macstrac.blogspot.com/
>> >
>> > Open Source SOA
>> > http://open.iona.com
>> >
>> >
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/broker1--%3Eq1-to-broker2--%3Eq2-tf4736085s2354.html#a13544096
>>
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source SOA
> http://open.iona.com
>
>
--
View this message in context: http://www.nabble.com/broker1--%3Eq1-to-broker2--%3Eq2-tf4736085s2354.html#a13544261
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: broker1-->q1 to broker2-->q2
Posted by James Strachan <ja...@gmail.com>.
It looks fine to me. Do you see the subscriber in the JMX console?
When you send a message to q1 do you see it being consumed from JMX?
On 02/11/2007, Viswanath Durbha <Vi...@gmail.com> wrote:
>
> Thanks for the super quick reply.
>
> I've done the following configuration to activemq_broker1.xml file. I've
> added two activemq components. And then I added a camel route. But it
> doesn't seem to work for me. Am I missing something here?
>
> <bean id="broker1" class="org.apache.camel.component.jms.JmsComponent">
> <property name="connectionFactory">
> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
> <property name="brokerURL"
> value="tcp://localhost:62001?broker.persistent=false"/>
> </bean>
> </property>
> </bean>
> <bean id="broker2" class="org.apache.camel.component.jms.JmsComponent">
> <property name="connectionFactory">
> <bean class="org.apache.activemq.ActiveMQConnectionFactory">
> <property name="brokerURL"
> value="tcp://localhost:63001?broker.persistent=false"/>
> </bean>
> </property>
> </bean>
> <camelContext id="camel"
> xmlns="http://activemq.apache.org/camel/schema/spring">
> <route>
> <from uri="broker1:q1"/>
> <to uri="broker2:q2"/>
> </route>
> </camelContext>
>
>
>
>
>
> James.Strachan wrote:
> >
> > On 02/11/2007, Viswanath Durbha <Vi...@gmail.com> wrote:
> >>
> >> Hi,
> >>
> >> I am using activemq 5.0. I have a question regarding forwarding messages
> >> from two pre-configured queues on different broker instances.
> >>
> >> Let's say I'm running two brokers broker1 and broker2. broker1 will have
> >> a
> >> queue q1 and broker2 will have a queue q2. How do I configure these
> >> brokers
> >> so that any message put in broker1-->q1 will be forwarded to
> >> broker2-->q2?
> >
> > If they are the same queue name you use a network of brokers.
> >
> > If you want to use different queues then using a Camel route is the
> > simplest...
> > http://activemq.apache.org/camel/
> >
> > <route>
> > <from uri="activemq:q1"/>
> > <to uri="remoteBroker:q2"/>
> > </route>
> >
> > --
> > James
> > -------
> > http://macstrac.blogspot.com/
> >
> > Open Source SOA
> > http://open.iona.com
> >
> >
>
>
> --
> View this message in context: http://www.nabble.com/broker1--%3Eq1-to-broker2--%3Eq2-tf4736085s2354.html#a13544096
>
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
--
James
-------
http://macstrac.blogspot.com/
Open Source SOA
http://open.iona.com
Re: broker1-->q1 to broker2-->q2
Posted by Viswanath Durbha <Vi...@gmail.com>.
Thanks for the super quick reply.
I've done the following configuration to activemq_broker1.xml file. I've
added two activemq components. And then I added a camel route. But it
doesn't seem to work for me. Am I missing something here?
<bean id="broker1" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL"
value="tcp://localhost:62001?broker.persistent=false"/>
</bean>
</property>
</bean>
<bean id="broker2" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL"
value="tcp://localhost:63001?broker.persistent=false"/>
</bean>
</property>
</bean>
<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="broker1:q1"/>
<to uri="broker2:q2"/>
</route>
</camelContext>
James.Strachan wrote:
>
> On 02/11/2007, Viswanath Durbha <Vi...@gmail.com> wrote:
>>
>> Hi,
>>
>> I am using activemq 5.0. I have a question regarding forwarding messages
>> from two pre-configured queues on different broker instances.
>>
>> Let's say I'm running two brokers broker1 and broker2. broker1 will have
>> a
>> queue q1 and broker2 will have a queue q2. How do I configure these
>> brokers
>> so that any message put in broker1-->q1 will be forwarded to
>> broker2-->q2?
>
> If they are the same queue name you use a network of brokers.
>
> If you want to use different queues then using a Camel route is the
> simplest...
> http://activemq.apache.org/camel/
>
> <route>
> <from uri="activemq:q1"/>
> <to uri="remoteBroker:q2"/>
> </route>
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source SOA
> http://open.iona.com
>
>
--
View this message in context: http://www.nabble.com/broker1--%3Eq1-to-broker2--%3Eq2-tf4736085s2354.html#a13544096
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: broker1-->q1 to broker2-->q2
Posted by James Strachan <ja...@gmail.com>.
On 02/11/2007, Viswanath Durbha <Vi...@gmail.com> wrote:
>
> Hi,
>
> I am using activemq 5.0. I have a question regarding forwarding messages
> from two pre-configured queues on different broker instances.
>
> Let's say I'm running two brokers broker1 and broker2. broker1 will have a
> queue q1 and broker2 will have a queue q2. How do I configure these brokers
> so that any message put in broker1-->q1 will be forwarded to broker2-->q2?
If they are the same queue name you use a network of brokers.
If you want to use different queues then using a Camel route is the simplest...
http://activemq.apache.org/camel/
<route>
<from uri="activemq:q1"/>
<to uri="remoteBroker:q2"/>
</route>
--
James
-------
http://macstrac.blogspot.com/
Open Source SOA
http://open.iona.com