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 <[EMAIL PROTECTED]>: > > 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. > >
