The failover transport's behavior is "connect to any one of the URIs in this set; if that connection dies, try connecting again to any URI in the set." By default, the failover transport will log if it is unable to get a connection to any of the URIs, and then wait for a while and try again. When you take down your broker, there are no more live brokers in that failover group, so the failover URI will fail and output those errors. So yes, those are expected behavior for the setup you've described. You can change the reconnect behavior and the retry pattern via the options at http://activemq.apache.org/failover-transport-reference.html.
As far as why your producer application won't stop, one possibility is that the producer thread is still active because it's trying to reconnect (after a sleep), so the application won't exit. If you're expecting your application to exit when it loses the broker connection, you might want to look at the maxReconnectAttempts URI option from the failover transport reference documentation linked above. On Mon, Oct 13, 2014 at 3:02 AM, bansalp <bpradee...@gmail.com> wrote: > I have tried with failover broker as well > ('failover(tcp://host1:61616,tcp://host2:61616)'), but still same problem. > > What could be reason for this. > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Unable-to-stop-producer-tp4686340p4686346.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >