You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by devylon <in...@gmail.com> on 2009/11/02 10:24:38 UTC
Queue Consumer and Failover setup
Hi,
i have setup my publishers to a queue with a failover connection
failover:(tcp://host1:61616,tcp://host2:61616)?randomize=true
in the monitoring and logfiles i can see how the messages are published
either
to host1 or host2.
For the consumer i'm using the same failover connection. BUT what i see
is that the consumer is only connecting to one of the brokers, e.g. host1.
All messages sent to host2 are pending in the queue.
How can i configure the consumer to connect to both brokers and consume both
queues ?
-- Ingo
--
View this message in context: http://old.nabble.com/Queue-Consumer-and-Failover-setup-tp26156637p26156637.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Queue Consumer and Failover setup
Posted by Gary Tully <ga...@gmail.com>.
The failover transport uses the URI list when asked to make a new
connection, so your publisher must be using a new connection for each
send but your consumer must be maintaining a single long lived
connection (which is no bad thing).
If you want your consumer to round robin between both brokers then you
need to have it close it's connection when it has consumed it's batch
quota.
2009/11/2 devylon <in...@gmail.com>:
>
> Hi,
>
> i have setup my publishers to a queue with a failover connection
> failover:(tcp://host1:61616,tcp://host2:61616)?randomize=true
>
> in the monitoring and logfiles i can see how the messages are published
> either
> to host1 or host2.
>
> For the consumer i'm using the same failover connection. BUT what i see
> is that the consumer is only connecting to one of the brokers, e.g. host1.
> All messages sent to host2 are pending in the queue.
>
> How can i configure the consumer to connect to both brokers and consume both
> queues ?
>
> -- Ingo
>
> --
> View this message in context: http://old.nabble.com/Queue-Consumer-and-Failover-setup-tp26156637p26156637.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
--
http://blog.garytully.com
Open Source Integration
http://fusesource.com
Re: Queue Consumer and Failover setup
Posted by Joe Fernandez <jo...@ttmsolutions.com>.
A connection is associated with only one broker. So you'd have to spawn two
threads and have each thread establish a connection to a different broker.
Thread 1's connection = failover://(tcp://host1:61616)
Thread 2's connection = failover://(tcp://host2:61616)
Using Camel, you'd simply create two JMS-based routes and have them both
pipe their messages to one Spring-based MDP. All you'd have to do is write
the MDP. Check out Camel, it really helps cut down on development and is
very cool.
Joe
http://www.ttmsolutions.com
devylon wrote:
>
> Hi,
>
> i have setup my publishers to a queue with a failover connection
> failover:(tcp://host1:61616,tcp://host2:61616)?randomize=true
>
> in the monitoring and logfiles i can see how the messages are published
> either
> to host1 or host2.
>
> For the consumer i'm using the same failover connection. BUT what i see
> is that the consumer is only connecting to one of the brokers, e.g. host1.
> All messages sent to host2 are pending in the queue.
>
> How can i configure the consumer to connect to both brokers and consume
> both
> queues ?
>
> -- Ingo
>
>
--
View this message in context: http://old.nabble.com/Queue-Consumer-and-Failover-setup-tp26156637p26157102.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.