You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Gabe Westmaas <ga...@mailtrust.com> on 2009/01/27 20:44:54 UTC

NMS and non-responsive queue

Hey all,

One of the developers in our company is writing an application that uses NMS and every once in a while the queue becomes unresponsive to consumers, although producers can continue to produce to it.  Other times a message will get stuck at the top of the queue and producers and consumers will read and write past it.

After talking with him, he is using it a little strangely, and I was just wondering if anyone can confirm this might cause the problem, since we can't always recreate the problem reliably and thus know if we have fixed it.

His NMS consumer had a prefetch of 1000, but after reading a maximum of 50 messages, he disconnects and reconnects.  It seems like this shouldn't cause an issue, especially since there is only one consumer.

After changing the prefetch to 20, we couldn't recreate the problem at all, but even now, after setting it back to 1000 we still can't recreate the issue again.

Any suggestions or ideas?

Thanks!
Gabe


Re: NMS and non-responsive queue

Posted by Jim Gomes <e....@gmail.com>.
Great!  Glad I was able to help.  I was once mystified by the same thing.  I
think I made some changes inside NMS to handle this in a more coherent
fashion.  It didn't make sense that a message flagged as non-persistent was
being sent as persistent.  Like I said, I would have to go and check the
code to remind myself as to how exactly I made the change.  It might have
been in my own client code in my applications rather than in NMS itself.
It's been a while...

Best,
Jim

On Fri, Jan 30, 2009 at 9:48 AM, mkeenan <ke...@p2sol.com> wrote:

>
>
>
> semog wrote:
> >
> > Check your producer settings.  The producer may override the message
> > setting.  Think of this as a "persistent producer" or "non-persistent
> > producer".
> >
>
> Thank you, that was it.
>
> For anyone using Spring.NET, please note that the [B]Persistent[/B]
> property
> on the [B]NmsTemplate[/B] class defaults to true and if you set it to false
> you [B]MUST[/B] also set [B]ExplicitQosEnabled[/B] to true (default is
> False) in order for your persistence setting to be used. Otherwise it will
> be ignored.
> --
> View this message in context:
> http://www.nabble.com/NMS-and-non-responsive-queue-tp21692908p21752228.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Re: NMS and non-responsive queue

Posted by mkeenan <ke...@p2sol.com>.


semog wrote:
> 
> Check your producer settings.  The producer may override the message
> setting.  Think of this as a "persistent producer" or "non-persistent
> producer". 
> 

Thank you, that was it.

For anyone using Spring.NET, please note that the [B]Persistent[/B] property
on the [B]NmsTemplate[/B] class defaults to true and if you set it to false
you [B]MUST[/B] also set [B]ExplicitQosEnabled[/B] to true (default is
False) in order for your persistence setting to be used. Otherwise it will
be ignored.
-- 
View this message in context: http://www.nabble.com/NMS-and-non-responsive-queue-tp21692908p21752228.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: NMS and non-responsive queue

Posted by Jim Gomes <e....@gmail.com>.
Check your producer settings.  The producer may override the message
setting.  Think of this as a "persistent producer" or "non-persistent
producer".  Whatever message is sent via a persistent producer, that message
will be flagged as persistent.  I seem to remember coming across this a
while back, but would need to re-investigate it.

On Fri, Jan 30, 2009 at 7:03 AM, mkeenan <ke...@p2sol.com> wrote:

>
>
> semog wrote:
> >
> > consumer" situation.  If the messages are flagged as non-persistent, then
> > everything works fine.  We are still working on narrowing down the
> > problem.
> >
>
> I'm having the same problem as the OP, so we put a workaround in our
> production system.
>
> However, I am interested in pursuing the non-persistent option but am
> having
> problems.  I am using Spring.NET, but I don't think the issue is in that
> code. In my log file I can see that a message with Persistent=False was
> sent
> by a message producer:
>
> [2009-01-30 08:45:25,541] [12] [DEBUG] [NmsTemplate] Sending created
> message
> [ActiveMQTextMessage[ ProducerId= Destination= TransactionId=
> OriginalDestination= MessageId= OriginalTransactionId= GroupID=
> GroupSequence=0 CorrelationId= Persistent=False Expiration=0 Priority=0
> ReplyTo= Timestamp=0 Type= Content=System.Byte[] MarshalledProperties=
> DataStructure= TargetConsumerId= Compressed=False RedeliveryCounter=0
> BrokerPath= Arrival=0 UserID= RecievedByDFBridge=False Droppable=False ]
> Text=message # 0001]
>
> In the JMX console, if I use the browseAsTable() method I see
> JMSDeliveryMode is PERSISTENT.  I have confirmed this is the case by
> stopping and restarting the broker-- the message is still on the queue.
>
> Is it possible I have a setting in the broker that forces all messages to
> persist? I thought it was a per-message setting only.
>
> I'm using Transactional acknowledgment mode, if that makes a difference.
>
> Thanks for any hints!
> --
> View this message in context:
> http://www.nabble.com/NMS-and-non-responsive-queue-tp21692908p21748760.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Re: NMS and non-responsive queue

Posted by mkeenan <ke...@p2sol.com>.

semog wrote:
> 
> consumer" situation.  If the messages are flagged as non-persistent, then
> everything works fine.  We are still working on narrowing down the
> problem.
> 

I'm having the same problem as the OP, so we put a workaround in our
production system.

However, I am interested in pursuing the non-persistent option but am having
problems.  I am using Spring.NET, but I don't think the issue is in that
code. In my log file I can see that a message with Persistent=False was sent
by a message producer:

[2009-01-30 08:45:25,541] [12] [DEBUG] [NmsTemplate] Sending created message
[ActiveMQTextMessage[ ProducerId= Destination= TransactionId=
OriginalDestination= MessageId= OriginalTransactionId= GroupID=
GroupSequence=0 CorrelationId= Persistent=False Expiration=0 Priority=0
ReplyTo= Timestamp=0 Type= Content=System.Byte[] MarshalledProperties=
DataStructure= TargetConsumerId= Compressed=False RedeliveryCounter=0
BrokerPath= Arrival=0 UserID= RecievedByDFBridge=False Droppable=False ]
Text=message # 0001]

In the JMX console, if I use the browseAsTable() method I see
JMSDeliveryMode is PERSISTENT.  I have confirmed this is the case by
stopping and restarting the broker-- the message is still on the queue.

Is it possible I have a setting in the broker that forces all messages to
persist? I thought it was a per-message setting only.

I'm using Transactional acknowledgment mode, if that makes a difference.

Thanks for any hints!
-- 
View this message in context: http://www.nabble.com/NMS-and-non-responsive-queue-tp21692908p21748760.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: NMS and non-responsive queue

Posted by Jim Gomes <e....@gmail.com>.
We have been encountering similar problems, but no definitive reproducible
steps.  Our analysis is pointing towards having the persistent flag turned
on for messages.  If the messages are flagged as persistent, then we can
encounter non-responsive consumers.  Understand that the consumer is not the
problem, it seems to be more with the broker.  The broker stops sending
messages to a consumer that is able to consume -- it is not a "slow
consumer" situation.  If the messages are flagged as non-persistent, then
everything works fine.  We are still working on narrowing down the problem.
You may want to check your message settings to see if you are using
persistence or not.

On Tue, Jan 27, 2009 at 11:44 AM, Gabe Westmaas <gabe.westmaas@mailtrust.com
> wrote:

> Hey all,
>
> One of the developers in our company is writing an application that uses
> NMS and every once in a while the queue becomes unresponsive to consumers,
> although producers can continue to produce to it.  Other times a message
> will get stuck at the top of the queue and producers and consumers will read
> and write past it.
>
> After talking with him, he is using it a little strangely, and I was just
> wondering if anyone can confirm this might cause the problem, since we can't
> always recreate the problem reliably and thus know if we have fixed it.
>
> His NMS consumer had a prefetch of 1000, but after reading a maximum of 50
> messages, he disconnects and reconnects.  It seems like this shouldn't cause
> an issue, especially since there is only one consumer.
>
> After changing the prefetch to 20, we couldn't recreate the problem at all,
> but even now, after setting it back to 1000 we still can't recreate the
> issue again.
>
> Any suggestions or ideas?
>
> Thanks!
> Gabe
>
>