You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Jigar Naik <ji...@interactcrm.com> on 2008/10/06 10:29:05 UTC

Consumer stop consuming messages from activeMQ

Hi,
i have written one thread, which will consume 10 messages from activeMQ
after every 10 Seconds. 

but my consumer stops consuming message from activeMQ after some time. and
the interval is unpredictable sometimes it stops consuming after 10
minutes... and sometimes after 10 hours. 

And the temporary solution i have found is Restarting the ActiveMQ Service.

Once i restart the activeMQ Service it starts consuming.

What could be the possible reason ?

please help me solving this issue... it's been 15 days i am stumbling with
this issue... 

Thanks 
Jigar
-- 
View this message in context: http://www.nabble.com/Consumer-stop-consuming-messages-from-activeMQ-tp19833825p19833825.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: Consumer stop consuming messages from activeMQ

Posted by Gary Tully <ga...@gmail.com>.
Increase the timeout on your receive call, it is possible that a
receive will fail to find a message immediately after a consumer is
created  due to the async nature of message dispatch. This may be what
you are experiencing.

in your code:  replace
message 		= consumer.receive(100);

with
message 		= consumer.receive(5000);



2008/10/6 Jigar Naik <ji...@interactcrm.com>:
>
> I have added few jconsole screen shots...  in which first three screens are
> taken when there were no messages in the amq, n the last one taken.. after
> consumer consumes 80 messages, and 20 messages still remaining to consume.
>
> http://www.nabble.com/file/p19835877/1.jpg
>
> http://www.nabble.com/file/p19835877/2.jpg
>
> http://www.nabble.com/file/p19835877/3.jpg
>
> http://www.nabble.com/file/p19835877/4.jpg
>
> is the all Jconsole stats correct ? or something wrong ?
>
> sorry i am new to JMS & activeMQ.
>
> Regards.
> Jigar.
>
> Jigar Naik wrote:
>>
>> Hi,
>> i have written one thread, which will consume 10 messages from activeMQ
>> after every 10 Seconds.
>>
>> but my consumer stops consuming message from activeMQ after some time. and
>> the interval is unpredictable sometimes it stops consuming after 10
>> minutes... and sometimes after 10 hours.
>>
>> And the temporary solution i have found is Restarting the ActiveMQ
>> Service.
>>
>> Once i restart the activeMQ Service it starts consuming.
>>
>> What could be the possible reason ?
>>
>> please help me solving this issue... it's been 15 days i am stumbling with
>> this issue...
>>
>> Thanks
>> Jigar
>>
>
> --
> View this message in context: http://www.nabble.com/Consumer-stop-consuming-messages-from-activeMQ-tp19833825p19835877.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>

Re: Consumer stop consuming messages from activeMQ

Posted by Jigar Naik <ji...@interactcrm.com>.
I have added few jconsole screen shots...  in which first three screens are
taken when there were no messages in the amq, n the last one taken.. after
consumer consumes 80 messages, and 20 messages still remaining to consume.

http://www.nabble.com/file/p19835877/1.jpg 

http://www.nabble.com/file/p19835877/2.jpg 

http://www.nabble.com/file/p19835877/3.jpg 

http://www.nabble.com/file/p19835877/4.jpg 

is the all Jconsole stats correct ? or something wrong ? 

sorry i am new to JMS & activeMQ.

Regards.
Jigar.

Jigar Naik wrote:
> 
> Hi,
> i have written one thread, which will consume 10 messages from activeMQ
> after every 10 Seconds. 
> 
> but my consumer stops consuming message from activeMQ after some time. and
> the interval is unpredictable sometimes it stops consuming after 10
> minutes... and sometimes after 10 hours. 
> 
> And the temporary solution i have found is Restarting the ActiveMQ
> Service.
> 
> Once i restart the activeMQ Service it starts consuming.
> 
> What could be the possible reason ?
> 
> please help me solving this issue... it's been 15 days i am stumbling with
> this issue... 
> 
> Thanks 
> Jigar
> 

-- 
View this message in context: http://www.nabble.com/Consumer-stop-consuming-messages-from-activeMQ-tp19833825p19835877.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: Consumer stop consuming messages from activeMQ

Posted by Jigar Naik <ji...@interactcrm.com>.
actually i m acknowledging the message.. have a look at my code.

http://www.nabble.com/file/p19835486/JmsUtil.java JmsUtil.java 

the JmsUtil.java contains three method... startConsume(..);
consumeFromActiveMQ(..); and endConsume(..); 

I have got another file 

which calls the startConsume(); n then calls the consumeFromActiveMQ(); 10
times in a loop for reading 10 messages from activeMQ and than calls the
endConsume(); 

Again after 10 second same cycle repeats...

Regards,
Jigar

Gary Tully wrote:
> 
> it seems like there is some problem with the acking of messages. If a
> message is not acked, only 'prefetch' number of messages will be
> dispatched. Can you use the JMX console to have a look at the broker
> queue and see what state it is in, ie: the number of messages, number
> dispatched etc.
> Ensure that your consumer does ack the messages, possibly post the
> code to your consumer.
> 
> 
> 2008/10/6 Jigar Naik <ji...@interactcrm.com>:
>>
>> Hi,
>> i have written one thread, which will consume 10 messages from activeMQ
>> after every 10 Seconds.
>>
>> but my consumer stops consuming message from activeMQ after some time.
>> and
>> the interval is unpredictable sometimes it stops consuming after 10
>> minutes... and sometimes after 10 hours.
>>
>> And the temporary solution i have found is Restarting the ActiveMQ
>> Service.
>>
>> Once i restart the activeMQ Service it starts consuming.
>>
>> What could be the possible reason ?
>>
>> please help me solving this issue... it's been 15 days i am stumbling
>> with
>> this issue...
>>
>> Thanks
>> Jigar
>> --
>> View this message in context:
>> http://www.nabble.com/Consumer-stop-consuming-messages-from-activeMQ-tp19833825p19833825.html
>> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Consumer-stop-consuming-messages-from-activeMQ-tp19833825p19835486.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: Consumer stop consuming messages from activeMQ

Posted by Gary Tully <ga...@gmail.com>.
it seems like there is some problem with the acking of messages. If a
message is not acked, only 'prefetch' number of messages will be
dispatched. Can you use the JMX console to have a look at the broker
queue and see what state it is in, ie: the number of messages, number
dispatched etc.
Ensure that your consumer does ack the messages, possibly post the
code to your consumer.


2008/10/6 Jigar Naik <ji...@interactcrm.com>:
>
> Hi,
> i have written one thread, which will consume 10 messages from activeMQ
> after every 10 Seconds.
>
> but my consumer stops consuming message from activeMQ after some time. and
> the interval is unpredictable sometimes it stops consuming after 10
> minutes... and sometimes after 10 hours.
>
> And the temporary solution i have found is Restarting the ActiveMQ Service.
>
> Once i restart the activeMQ Service it starts consuming.
>
> What could be the possible reason ?
>
> please help me solving this issue... it's been 15 days i am stumbling with
> this issue...
>
> Thanks
> Jigar
> --
> View this message in context: http://www.nabble.com/Consumer-stop-consuming-messages-from-activeMQ-tp19833825p19833825.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>