You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Syed <sy...@gaianconsultants.com> on 2018/04/27 05:50:31 UTC

Restart of ActiveMQ server (with MySql persistence) makes consumer return null always

Hi,
  I have two activemq instances setup with MySql persistence.  I started the
servers, and produced 50 msgs thru Producer using failover.  Then I started
consumer using failover to consume message thru receive(5000) method.  The
consumer indeed consumes.  During this execution, I stop one instance and
then restart it.  The consumer still consumes.  Now when the second instance
is stopped, thats where I am running into trouble.  Consumer doesn't consume
at all.  Even I restart second instance, and re-run my consumer program
again, still no messages are consumed.

Any suggestions on how to make consumer consume even upon restarts?



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: Restart of ActiveMQ server (with MySql persistence) makes consumer return null always

Posted by Syed <sy...@gaianconsultants.com>.
Thanks Tim.  I am using Active MQ 5.14.2.  I think its a bug in this version. 
When I use latest 5.15.3, I don't see that behaviour.

I am using Queue not a topic.

Yes, my messages are flagged as persistent when sent.  Message expiration is
not a factor here.  The messages are indeed available when I check the MySQL
database.  But consumer doesn't pick them up.  I am able to successfully
reconnect but consumer consumes null all the time though unread messages
exist in the queue.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: Restart of ActiveMQ server (with MySql persistence) makes consumer return null always

Posted by Tim Bain <tb...@alumni.duke.edu>.
What version are you using?

Are you using a queue or a topic? If a topic, is your subscription durable
or non-durable?

Are your messages flagged as persistent when sent? Does a JMX viewer such
as JConsole show that they exist in the broker after a restart?

Is message expiration a factor?

Does your client reconnect successfully but get no messages, or does it
fail to reconnect at all?

Tim

On Fri, Apr 27, 2018, 7:39 AM Syed <sy...@gaianconsultants.com>
wrote:

> Hi,
>   I have two activemq instances setup with MySql persistence.  I started
> the
> servers, and produced 50 msgs thru Producer using failover.  Then I started
> consumer using failover to consume message thru receive(5000) method.  The
> consumer indeed consumes.  During this execution, I stop one instance and
> then restart it.  The consumer still consumes.  Now when the second
> instance
> is stopped, thats where I am running into trouble.  Consumer doesn't
> consume
> at all.  Even I restart second instance, and re-run my consumer program
> again, still no messages are consumed.
>
> Any suggestions on how to make consumer consume even upon restarts?
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>