You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jigar Naik <ji...@interactcrm.com> on 2008/07/11 13:39:44 UTC

JMS consumer is not receiving any messages. am i missing something ?

Hi The uploaded file contains the consumer code. but the consumer is not
receiving any messages even though there are 10 messages in the queue. I
have tried to debug the code. but i found it is not calling the onMessage()
method.

Am i missing something ?

http://www.nabble.com/file/p18401944/JConsumer.java JConsumer.java 

Thanks 
Jigar
-- 
View this message in context: http://www.nabble.com/JMS-consumer-is-not-receiving-any-messages.-am-i-missing-something---tp18401944p18401944.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: JMS consumer is not receiving any messages. am i missing something ?

Posted by Rob Davies <ra...@gmail.com>.
You should only close those resources when your app no longer wants to  
receive messages.
On 11 Jul 2008, at 13:02, Jigar Naik wrote:

>
>
>
> Jigar Naik wrote:
>>
>> Hi The uploaded file contains the consumer code. but the consumer  
>> is not
>> receiving any messages even though there are 10 messages in the  
>> queue. I
>> have tried to debug the code. but i found it is not calling the
>> onMessage() method.
>>
>> Am i missing something ?
>>
>> http://www.nabble.com/file/p18401944/JConsumer.java JConsumer.java
>>
>> Thanks
>> Jigar
>>
>
> Hey,
>
> I have commented the following line of  code. and i received all the
> messages. It is behaving the way it should now.
>
> 			//consumer.close();
> 			//session.close();
> 			//connection.close();
>
> but the question is now when should i close consumer, session and  
> connection
> object ???
> -- 
> View this message in context: http://www.nabble.com/JMS-consumer-is-not-receiving-any-messages.-am-i-missing-something---tp18401944p18402295.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


Re: JMS consumer is not receiving any messages. am i missing something ?

Posted by Jigar Naik <ji...@interactcrm.com>.


Jigar Naik wrote:
> 
> Hi The uploaded file contains the consumer code. but the consumer is not
> receiving any messages even though there are 10 messages in the queue. I
> have tried to debug the code. but i found it is not calling the
> onMessage() method.
> 
> Am i missing something ?
> 
>  http://www.nabble.com/file/p18401944/JConsumer.java JConsumer.java 
> 
> Thanks 
> Jigar
> 

Hey,

I have commented the following line of  code. and i received all the
messages. It is behaving the way it should now. 

			//consumer.close();
			//session.close();
			//connection.close();

but the question is now when should i close consumer, session and connection
object ???
-- 
View this message in context: http://www.nabble.com/JMS-consumer-is-not-receiving-any-messages.-am-i-missing-something---tp18401944p18402295.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.