You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Emmanuel Bourg <eb...@apache.org> on 2010/05/28 19:42:00 UTC

Message count alerts

Hi,

I noticed message count alerts in my server log (Qpid 0.6 Java server) 
and I don't understand why it happens.

2010-05-28 19:31:33,286 [INFO ] MESSAGE_COUNT_ALERT On Queue 
guest-684546 - 8272: Maximum count on queue threshold (50) breached

I have a producer emitting messages with accept-mode none and 
acquire-more set to pre-acquired. The messages are routed to a private 
queue through the amq.topic exchange. The client subscribed to this 
queue with the same accept-mode and acquire-mode. The client receives 
the messages properly.

Using the JMX Management Console I can see the message count increasing 
for this queue. I tried to set a TTL on the messages produced but that 
didn't change anything, the queue keeps growing.

Did I miss something?

Emmanuel Bourg


Re: Message count alerts

Posted by Marnie McCormack <ma...@googlemail.com>.
Hi Emmanuel,

I'm not familiar with the non-JMS API - but if your MessageCount and
ReceivedMessageCount are equal then that indicates that the messages are
still on the queue i.e. not ack'd.

Sorry I can't help more, but I'm not up on the logic with the lower level so
I don't know how it could/should be used as you're making use of it.

Anyone else know ?

Thanks,
Marnie

ps What features do you need out of interest that the JMS API doesn't expose
? Thx
On Mon, May 31, 2010 at 9:11 AM, Emmanuel Bourg <eb...@apache.org> wrote:

> Le 29/05/2010 17:47, Marnie McCormack a écrit :
>
>
> What client are you using to consume the messages ? (I'm assuming not java
>> since the accept-mode and acquire-mode settings are not ringing any bells
>> with me !)
>>
>
> I'm using the Java client, but the non-JMS one in the
> org.apache.qpid.transport package. I know it isn't officially supported by
> it has some features missing in the JMS client that I need.
>
>
>
> If your MessageCount (as opposed to ReceivedMessageCount) is not going down
>> then the messages are likely not being ack'd by the consumer.
>>
>
> The message count and received message count are equals. By reading the
> AMQP spec I was under the impression that in implicit/pre-acquired mode the
> acknowledgment wasn't required, and the messages were removed automatically
> from the queue once they were transfered to the client. Is this correct?
>
>
>
> On the java broker, all subscribers to a topic get their own private queue
>> created as a temp queue - how exactly are you subscibing to the queue
>> (whats
>> the queue called?) - is it possible you have multiple subscribers and one
>> of
>> them is not ack-ing ?
>>
>
> There is exactly one producer and one subscriber. The private queue is
> declared like this:
>
>  // declare the queue
>  String queue = username + "-" + System.currentTimeMillis();
>  session.queueDeclare(queue, null, null, Option.EXCLUSIVE,
> Option.AUTO_DELETE);
>  session.messageSubscribe(queue, queue, MessageAcceptMode.NONE,
> MessageAcquireMode.PRE_ACQUIRED, null, 0, null);
>
>  // issue credit
>  session.messageFlow(queue, MessageCreditUnit.BYTE,
> Session.UNLIMITED_CREDIT);
>  session.messageFlow(queue, MessageCreditUnit.MESSAGE,
> Session.UNLIMITED_CREDIT);
>
>  // bind a topic to the queue
>  session.exchangeBind(queue, "amq.topic", "foo.bar", null);
>
>
> And on the producer side the messages are sent with:
>
>  DeliveryProperties deliveryProps =  new DeliveryProperties();
>  deliveryProps.setDiscardUnroutable(true);
>  deliveryProps.setDeliveryMode(MessageDeliveryMode.NON_PERSISTENT);
>  deliveryProps.setRoutingKey("foo.bar");
>
>  session.messageTransfer("amq.topic", MessageAcceptMode.NONE,
> MessageAcquireMode.PRE_ACQUIRED, new Header(deliveryProps), msg);
>
>
> Emmanuel Bourg
>
>

Re: Message count alerts

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 31/05/2010 22:36, Robert Godfrey a écrit :

> I believe there was a bug in the 0-10 code with regards to
> accept-mode=NONE in the 0.6 release that I subsequently fixed.  this
> is probably what is being seen...

I retried with the broker from the trunk and this time it worked fine, 
the message count remained at zero. I should have checked first before 
asking, sorry for the trouble.

Thanks everyone for the help!

Emmanuel Bourg


Re: Message count alerts

Posted by Robert Godfrey <ro...@gmail.com>.
Sorry for coming late to this thread...

On 31 May 2010 22:06, Robbie Gemmell <ro...@gmail.com> wrote:
> As far as I understand it, setting acquire-mode=PRE_ACQUIRED together with
> accept-mode=NONE is the equivalent of NO_ACK mode in JMS terms, whereby the
> message is acquired on the broker before being sent to the client and is
> then disposed of immediately upon send since no acceptance/acknowledgement
> is to be returned.
>
> I just tried a noddy example based on a modified version of the old
> o.a.q.example.amqpexample.direct package and it seemed to work as expected,
> the messages were sent and received ok and the message count for the queue
> dropped to 0.
>
> I used the trunk broker as it's what I happened to have running but if you
> can fully replicate the issue on 0.6, could you also try it against trunk
> and see if it is the same? I can think only think of one issue that has
> touched this space in particular recently, but I don't think it would cause
> this. It is 6 months since 0.6 branched for release and the 0-10 protocol
> support in the Java broker was new at the time so I think trying it against
> trunk would be wise in any case.
>

I believe there was a bug in the 0-10 code with regards to
accept-mode=NONE in the 0.6 release that I subsequently fixed.  this
is probably what is being seen... However if trunk does not fix this
for you, please raise a JIRA as Robbie suggested.  I'm a little
swamped with AMQP stuff right now, but after the AMQP event next week
I should have a little more time to look at Qpid again :-)

My apologies...

-- Rob

> If it does act the same against trunk could you raise a new JIRA and attach
> a full sample program to reproduce if you have it, then we'll look into it
> at it some point.
>
> Regards,
> Robbie
>
>> -----Original Message-----
>> From: Emmanuel Bourg [mailto:ebourg@apache.org]
>> Sent: 31 May 2010 09:12
>> To: dev@qpid.apache.org
>> Subject: Re: Message count alerts
>>
>> Le 29/05/2010 17:47, Marnie McCormack a écrit :
>>
>> > What client are you using to consume the messages ? (I'm assuming not
>> java
>> > since the accept-mode and acquire-mode settings are not ringing any
>> bells
>> > with me !)
>>
>> I'm using the Java client, but the non-JMS one in the
>> org.apache.qpid.transport package. I know it isn't officially supported
>> by it has some features missing in the JMS client that I need.
>>
>>
>> > If your MessageCount (as opposed to ReceivedMessageCount) is not
>> going down
>> > then the messages are likely not being ack'd by the consumer.
>>
>> The message count and received message count are equals. By reading the
>> AMQP spec I was under the impression that in implicit/pre-acquired mode
>> the acknowledgment wasn't required, and the messages were removed
>> automatically from the queue once they were transfered to the client.
>> Is
>> this correct?
>>
>>
>> > On the java broker, all subscribers to a topic get their own private
>> queue
>> > created as a temp queue - how exactly are you subscibing to the queue
>> (whats
>> > the queue called?) - is it possible you have multiple subscribers and
>> one of
>> > them is not ack-ing ?
>>
>> There is exactly one producer and one subscriber. The private queue is
>> declared like this:
>>
>>    // declare the queue
>>    String queue = username + "-" + System.currentTimeMillis();
>>    session.queueDeclare(queue, null, null, Option.EXCLUSIVE,
>> Option.AUTO_DELETE);
>>    session.messageSubscribe(queue, queue, MessageAcceptMode.NONE,
>> MessageAcquireMode.PRE_ACQUIRED, null, 0, null);
>>
>>    // issue credit
>>    session.messageFlow(queue, MessageCreditUnit.BYTE,
>> Session.UNLIMITED_CREDIT);
>>    session.messageFlow(queue, MessageCreditUnit.MESSAGE,
>> Session.UNLIMITED_CREDIT);
>>
>>    // bind a topic to the queue
>>    session.exchangeBind(queue, "amq.topic", "foo.bar", null);
>>
>>
>> And on the producer side the messages are sent with:
>>
>>    DeliveryProperties deliveryProps =  new DeliveryProperties();
>>    deliveryProps.setDiscardUnroutable(true);
>>    deliveryProps.setDeliveryMode(MessageDeliveryMode.NON_PERSISTENT);
>>    deliveryProps.setRoutingKey("foo.bar");
>>
>>    session.messageTransfer("amq.topic", MessageAcceptMode.NONE,
>> MessageAcquireMode.PRE_ACQUIRED, new Header(deliveryProps), msg);
>>
>>
>> Emmanuel Bourg
>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


RE: Message count alerts

Posted by Robbie Gemmell <ro...@gmail.com>.
As far as I understand it, setting acquire-mode=PRE_ACQUIRED together with
accept-mode=NONE is the equivalent of NO_ACK mode in JMS terms, whereby the
message is acquired on the broker before being sent to the client and is
then disposed of immediately upon send since no acceptance/acknowledgement
is to be returned.

I just tried a noddy example based on a modified version of the old
o.a.q.example.amqpexample.direct package and it seemed to work as expected,
the messages were sent and received ok and the message count for the queue
dropped to 0. 

I used the trunk broker as it's what I happened to have running but if you
can fully replicate the issue on 0.6, could you also try it against trunk
and see if it is the same? I can think only think of one issue that has
touched this space in particular recently, but I don't think it would cause
this. It is 6 months since 0.6 branched for release and the 0-10 protocol
support in the Java broker was new at the time so I think trying it against
trunk would be wise in any case. 

If it does act the same against trunk could you raise a new JIRA and attach
a full sample program to reproduce if you have it, then we'll look into it
at it some point.

Regards,
Robbie

> -----Original Message-----
> From: Emmanuel Bourg [mailto:ebourg@apache.org]
> Sent: 31 May 2010 09:12
> To: dev@qpid.apache.org
> Subject: Re: Message count alerts
> 
> Le 29/05/2010 17:47, Marnie McCormack a écrit :
> 
> > What client are you using to consume the messages ? (I'm assuming not
> java
> > since the accept-mode and acquire-mode settings are not ringing any
> bells
> > with me !)
> 
> I'm using the Java client, but the non-JMS one in the
> org.apache.qpid.transport package. I know it isn't officially supported
> by it has some features missing in the JMS client that I need.
> 
> 
> > If your MessageCount (as opposed to ReceivedMessageCount) is not
> going down
> > then the messages are likely not being ack'd by the consumer.
> 
> The message count and received message count are equals. By reading the
> AMQP spec I was under the impression that in implicit/pre-acquired mode
> the acknowledgment wasn't required, and the messages were removed
> automatically from the queue once they were transfered to the client.
> Is
> this correct?
> 
> 
> > On the java broker, all subscribers to a topic get their own private
> queue
> > created as a temp queue - how exactly are you subscibing to the queue
> (whats
> > the queue called?) - is it possible you have multiple subscribers and
> one of
> > them is not ack-ing ?
> 
> There is exactly one producer and one subscriber. The private queue is
> declared like this:
> 
>    // declare the queue
>    String queue = username + "-" + System.currentTimeMillis();
>    session.queueDeclare(queue, null, null, Option.EXCLUSIVE,
> Option.AUTO_DELETE);
>    session.messageSubscribe(queue, queue, MessageAcceptMode.NONE,
> MessageAcquireMode.PRE_ACQUIRED, null, 0, null);
> 
>    // issue credit
>    session.messageFlow(queue, MessageCreditUnit.BYTE,
> Session.UNLIMITED_CREDIT);
>    session.messageFlow(queue, MessageCreditUnit.MESSAGE,
> Session.UNLIMITED_CREDIT);
> 
>    // bind a topic to the queue
>    session.exchangeBind(queue, "amq.topic", "foo.bar", null);
> 
> 
> And on the producer side the messages are sent with:
> 
>    DeliveryProperties deliveryProps =  new DeliveryProperties();
>    deliveryProps.setDiscardUnroutable(true);
>    deliveryProps.setDeliveryMode(MessageDeliveryMode.NON_PERSISTENT);
>    deliveryProps.setRoutingKey("foo.bar");
> 
>    session.messageTransfer("amq.topic", MessageAcceptMode.NONE,
> MessageAcquireMode.PRE_ACQUIRED, new Header(deliveryProps), msg);
> 
> 
> Emmanuel Bourg



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: Message count alerts

Posted by Emmanuel Bourg <eb...@apache.org>.
Le 29/05/2010 17:47, Marnie McCormack a écrit :

> What client are you using to consume the messages ? (I'm assuming not java
> since the accept-mode and acquire-mode settings are not ringing any bells
> with me !)

I'm using the Java client, but the non-JMS one in the 
org.apache.qpid.transport package. I know it isn't officially supported 
by it has some features missing in the JMS client that I need.


> If your MessageCount (as opposed to ReceivedMessageCount) is not going down
> then the messages are likely not being ack'd by the consumer.

The message count and received message count are equals. By reading the 
AMQP spec I was under the impression that in implicit/pre-acquired mode 
the acknowledgment wasn't required, and the messages were removed 
automatically from the queue once they were transfered to the client. Is 
this correct?


> On the java broker, all subscribers to a topic get their own private queue
> created as a temp queue - how exactly are you subscibing to the queue (whats
> the queue called?) - is it possible you have multiple subscribers and one of
> them is not ack-ing ?

There is exactly one producer and one subscriber. The private queue is 
declared like this:

   // declare the queue
   String queue = username + "-" + System.currentTimeMillis();
   session.queueDeclare(queue, null, null, Option.EXCLUSIVE, 
Option.AUTO_DELETE);
   session.messageSubscribe(queue, queue, MessageAcceptMode.NONE, 
MessageAcquireMode.PRE_ACQUIRED, null, 0, null);

   // issue credit
   session.messageFlow(queue, MessageCreditUnit.BYTE, 
Session.UNLIMITED_CREDIT);
   session.messageFlow(queue, MessageCreditUnit.MESSAGE, 
Session.UNLIMITED_CREDIT);

   // bind a topic to the queue
   session.exchangeBind(queue, "amq.topic", "foo.bar", null);


And on the producer side the messages are sent with:

   DeliveryProperties deliveryProps =  new DeliveryProperties();
   deliveryProps.setDiscardUnroutable(true);
   deliveryProps.setDeliveryMode(MessageDeliveryMode.NON_PERSISTENT);
   deliveryProps.setRoutingKey("foo.bar");

   session.messageTransfer("amq.topic", MessageAcceptMode.NONE, 
MessageAcquireMode.PRE_ACQUIRED, new Header(deliveryProps), msg);


Emmanuel Bourg


Re: Message count alerts

Posted by Marnie McCormack <ma...@googlemail.com>.
Hi Emmanuel,

What client are you using to consume the messages ? (I'm assuming not java
since the accept-mode and acquire-mode settings are not ringing any bells
with me !)

If your MessageCount (as opposed to ReceivedMessageCount) is not going down
then the messages are likely not being ack'd by the consumer.
On the java broker, all subscribers to a topic get their own private queue
created as a temp queue - how exactly are you subscibing to the queue (whats
the queue called?) - is it possible you have multiple subscribers and one of
them is not ack-ing ?

Marnie
On Fri, May 28, 2010 at 6:42 PM, Emmanuel Bourg <eb...@apache.org> wrote:

> Hi,
>
> I noticed message count alerts in my server log (Qpid 0.6 Java server) and
> I don't understand why it happens.
>
> 2010-05-28 19:31:33,286 [INFO ] MESSAGE_COUNT_ALERT On Queue guest-684546 -
> 8272: Maximum count on queue threshold (50) breached
>
> I have a producer emitting messages with accept-mode none and acquire-more
> set to pre-acquired. The messages are routed to a private queue through the
> amq.topic exchange. The client subscribed to this queue with the same
> accept-mode and acquire-mode. The client receives the messages properly.
>
> Using the JMX Management Console I can see the message count increasing for
> this queue. I tried to set a TTL on the messages produced but that didn't
> change anything, the queue keeps growing.
>
> Did I miss something?
>
> Emmanuel Bourg
>
>