activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Januszek <konieczn...@gmail.com>
Subject ActiveMQ failover transport - producers/consumers work on different hosts
Date Mon, 05 Dec 2016 11:26:42 GMT
ConnectionURL


failover:(tcp://broker1:61616,tcp://broker2:61616)?andomize=false&jms.useAsyncSend=false&jms.dispatchAsync=false&maxReconnectAttempts=30&maxReconnectDelay=3000&jms.prefetchPolicy.queuePrefetch=1000

Scenario:


*Producer puts a message to the queue_1*
create connection
put message
close connection

*Listener (auto_ack) - has a long lived connection since this is a listener*
retrieves the message
puts it in queue_2 (client_ack)

*Thread that runs periodically*
create connection
retrieves everything from queue_2
processes messages
ack messages
close connection

The problem
 Broker_1 goes down. FailoverTransport redirects traffic to broker_2. All
three pieces (Procuder, Listener and Thread) work with broker_2). broker_1
is brought back. Procuder and Thread connect to broker_1. Listener remains
on broker_2. Surprisingly - the onMessage is called when message arives to
queue_1 on broker_1, but listener puts the message to queue_2 on broker_2.

How can I instruct the listener to reconnect to broker_1 once its
operational again? Or should I rather force Producer and Thread work with
broker_2 as long as it's operational?



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-failover-transport-producers-consumers-work-on-different-hosts-tp4719747.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message