You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by bansalp <bp...@gmail.com> on 2014/10/13 09:07:33 UTC
Unable to stop producer
Hi,
I have activemq producer which keeps on producing message over a test queue.
It is using failover mechanism but my uri contain only one broker address
(tcp://host:61616).
I am getting logs similar to this in my log files and when am trying to stop
this producer its not getting stopped.
*[20141013 12:27:12.469 IST (ActiveMQ Task-3)
org.apache.activemq.transport.failover.FailoverTransport#getConnectList 804
DEBUG] - urlList connectionList:[tcp://host:61616], from: [tcp://host:61616]
[20141013 12:27:12.470 IST (ActiveMQ Task-3)
org.apache.activemq.transport.failover.FailoverTransport#doReconnect 990
DEBUG] - Waiting 30000 ms before attempting connection. *
Can somebody please explain is this expected or there is something wrong?
Thanks,
--
View this message in context: http://activemq.2283324.n4.nabble.com/Unable-to-stop-producer-tp4686340.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Unable to stop producer
Posted by Tim Bain <tb...@alumni.duke.edu>.
An application will exit when no more non-daemon threads exist. I don't
know whether the failover thread is a daemon or non-daemon thread, but you
could attach a debugger to your producer and connect to the iterate()
method of the Task created in
FailoverTransport.FailoverTransport.FailoverTransport(). (Yes, that name
is correct; the class FailoverTransport has an inner class also named
FailoverTransport, and the Task is created in its constructor. I don't
know why the inner class was given the same name as its containing class.)
When you hit your breakpoint, check if the currentThread's isDaemon()
method and you'll know.
On Tue, Oct 14, 2014 at 12:37 AM, bansalp <bp...@gmail.com> wrote:
> Hi,
>
> I am not expecting my producer to exist after it looses connection from
> broker. I want my client to stop when I want them to stop, but with
> producer
> its not happening. I had to do a kill -9 pid to stop the process (kill pid
> is not working). Am unable to understand this behaviour of producer.
>
> Can't I stop producer when its waiting to try to reconnect to a broker?
>
>
> Thanks,
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/Unable-to-stop-producer-tp4686340p4686364.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Re: Unable to stop producer
Posted by bansalp <bp...@gmail.com>.
Hi,
I am not expecting my producer to exist after it looses connection from
broker. I want my client to stop when I want them to stop, but with producer
its not happening. I had to do a kill -9 pid to stop the process (kill pid
is not working). Am unable to understand this behaviour of producer.
Can't I stop producer when its waiting to try to reconnect to a broker?
Thanks,
--
View this message in context: http://activemq.2283324.n4.nabble.com/Unable-to-stop-producer-tp4686340p4686364.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Unable to stop producer
Posted by Tim Bain <tb...@alumni.duke.edu>.
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 <bp...@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.
>
Re: Unable to stop producer
Posted by bansalp <bp...@gmail.com>.
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.