• Post Reply Bookmark Topic Watch Topic
  • New Topic

JMS with JBOSS 5- consumer not picking up messages sometimes  RSS feed

 
Chandni Jain
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

We recently upgraded to Jboss 5 and are using the default Jboss messaging. I have a producer and a consumer class and strangely sometimes the consumer class picks up the messages from the queue and most of the time does not.
The consumer is a Jboss service bean so that it can be invoked from the JMX console else it wakes up only once a day by using Quartz timer.

I am not sure if I am missing something.

Following code line I am using to get the messages.

for (MapMessage message = (MapMessage) consumer.receiveNoWait(); message != null; message =(MapMessage) consumer.receiveNoWait()) {
}

Any help would be greatly appreciated.

Thanks,
-Chandni
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should check if the msg isnt expiring on the server before your client had a chance to pick it up.

ram.
 
Chandni Jain
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Ram.

The messages were not expired.
I could find a way to make the consumer pick up the messages... for some reason when I used to debug my consumer it used to pick it up. So by putting a delay of 5 sec I am able to make it work.

Thanks,
-Chandni
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!