You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Swapnil <sw...@persistent.co.in> on 2013/07/31 15:49:24 UTC

ActiveMQ stops sending messages to Queue Consumer in case of consumer not acknowledging messages

Hello,

We have a use case wherein we create just one consumer to process messages
in the Queue. Message processor accumulates certain number of messages
before acknowledging. Receiving messages in Asynchronous way and using
Transacted session. Size of message is very small.

Active MQ stops sending further messages to sole consumer after certain
number of messages. We have tried solutions like consumer./prefetchSize/,
consumer./maximumPendingMessageLimit/; but nothing is working.
We tried similar use case with a durable topic with just one subscriber and
it works fine.

Activemq version : ActiveMQ 5.6.0
Queue configuration : Durable queue
Consumer : Asynchronous and uses transacted session as acknowledgement mode

Please let me know if anybody has faced similar issue.

Regards,
Swapnil




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-stops-sending-messages-to-Queue-Consumer-in-case-of-consumer-not-acknowledging-messages-tp4669923.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Re:Re: ActiveMQ stops sending messages to Queue Consumer in case of consumer not acknowledging messages

Posted by Swapnil <sw...@persistent.co.in>.
Increasing the value of the /memoryLimit /attribute in the
/conf/activemq.xml/ configuration file solved my issue. JMS started sending
messages without waiting for acknowledgement.

Thanks SuoNayi for exactly pointing out the issue.




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-stops-sending-messages-to-Queue-Consumer-in-case-of-consumer-not-acknowledging-messages-tp4669923p4670047.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re:Re: ActiveMQ stops sending messages to Queue Consumer in case of consumer not acknowledging messages

Posted by SuoNayi <su...@163.com>.
Memory usage limit can contriubte this issue. 
Since your queue's memory is exhausted by those messages that were dispatched to consumers but not acked by consumers.
When broker page more messages from the store it will check if the queue has enough memory space to load new messages, 
if no then no more new messages will be loaded and dispatched to conumers.I suppose the memory usage limit of your queue is 
the default value(1MB),then when 1MB size messges have dispatched to your consumers and no acks come back, 
then broker can not dispatch more messages due to memory usage limit.

At 2013-08-01 22:36:34,"Christian Posta" <ch...@gmail.com> wrote:
>Post your client code
>
>On Wednesday, July 31, 2013, Swapnil wrote:
>
>> Yes, I am calling commit on the session but only after receiving say X
>> number
>> of messages. Consumer will accumulate X number of messages before
>> processing
>> and acknowledging them.
>>
>> This X is configurable number. We tried with 500 and consumer was receiving
>> only around 350 messages. Messages which are enqueued and pending was
>> around
>> 5000.
>>
>> Number of messages sent by JMS varies as per the size of message (larger
>> the
>> size, less number of messages received by consumer). After sending say 350
>> messages to consumer, JMS waits till acknowledgment before sending further
>> batch of messages.
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://activemq.2283324.n4.nabble.com/ActiveMQ-stops-sending-messages-to-Queue-Consumer-in-case-of-consumer-not-acknowledging-messages-tp4669923p4669969.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>
>
>-- 
>*Christian Posta*
>http://www.christianposta.com/blog
>twitter: @christianposta

Re: ActiveMQ stops sending messages to Queue Consumer in case of consumer not acknowledging messages

Posted by Christian Posta <ch...@gmail.com>.
Post your client code

On Wednesday, July 31, 2013, Swapnil wrote:

> Yes, I am calling commit on the session but only after receiving say X
> number
> of messages. Consumer will accumulate X number of messages before
> processing
> and acknowledging them.
>
> This X is configurable number. We tried with 500 and consumer was receiving
> only around 350 messages. Messages which are enqueued and pending was
> around
> 5000.
>
> Number of messages sent by JMS varies as per the size of message (larger
> the
> size, less number of messages received by consumer). After sending say 350
> messages to consumer, JMS waits till acknowledgment before sending further
> batch of messages.
>
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-stops-sending-messages-to-Queue-Consumer-in-case-of-consumer-not-acknowledging-messages-tp4669923p4669969.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: ActiveMQ stops sending messages to Queue Consumer in case of consumer not acknowledging messages

Posted by Swapnil <sw...@persistent.co.in>.
Yes, I am calling commit on the session but only after receiving say X number
of messages. Consumer will accumulate X number of messages before processing
and acknowledging them.

This X is configurable number. We tried with 500 and consumer was receiving
only around 350 messages. Messages which are enqueued and pending was around
5000. 

Number of messages sent by JMS varies as per the size of message (larger the
size, less number of messages received by consumer). After sending say 350
messages to consumer, JMS waits till acknowledgment before sending further
batch of messages.





--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-stops-sending-messages-to-Queue-Consumer-in-case-of-consumer-not-acknowledging-messages-tp4669923p4669969.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ stops sending messages to Queue Consumer in case of consumer not acknowledging messages

Posted by Christian Posta <ch...@gmail.com>.
Is the consume sending ack's back? Are you calling commit on your session?

Might help to post your code


On Wed, Jul 31, 2013 at 6:49 AM, Swapnil
<sw...@persistent.co.in>wrote:

> Hello,
>
> We have a use case wherein we create just one consumer to process messages
> in the Queue. Message processor accumulates certain number of messages
> before acknowledging. Receiving messages in Asynchronous way and using
> Transacted session. Size of message is very small.
>
> Active MQ stops sending further messages to sole consumer after certain
> number of messages. We have tried solutions like consumer./prefetchSize/,
> consumer./maximumPendingMessageLimit/; but nothing is working.
> We tried similar use case with a durable topic with just one subscriber and
> it works fine.
>
> Activemq version : ActiveMQ 5.6.0
> Queue configuration : Durable queue
> Consumer : Asynchronous and uses transacted session as acknowledgement mode
>
> Please let me know if anybody has faced similar issue.
>
> Regards,
> Swapnil
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-stops-sending-messages-to-Queue-Consumer-in-case-of-consumer-not-acknowledging-messages-tp4669923.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: ActiveMQ stops sending messages to Queue Consumer in case of consumer not acknowledging messages

Posted by Swapnil <sw...@persistent.co.in>.
Nope, its not 200. Number of messages sent by JMS to consumer varies as per
the size of message. IF all messages are of same size, then number is very
consistent. 

Problem is JMS waits for acknowledgment before sending further batch of
messages. If consumer acknowledges after receiving small set of messages,
say after every 50 messages, then it works fine and all messages gets
dequeued appropriately.





--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-stops-sending-messages-to-Queue-Consumer-in-case-of-consumer-not-acknowledging-messages-tp4669923p4669970.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ stops sending messages to Queue Consumer in case of consumer not acknowledging messages

Posted by Jake Choi <jw...@yahoo-inc.com>.
Swapnil wrote
> Active MQ stops sending further messages to sole consumer after certain
> number of messages.

Is this "certain number of messages" equal to persistent adapter's
MAX_PAGE_SIZE (200)?



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-stops-sending-messages-to-Queue-Consumer-in-case-of-consumer-not-acknowledging-messages-tp4669923p4669952.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.