• Post Reply Bookmark Topic Watch Topic
  • New Topic

Make MDB wait/sleep for sometime programmatically  RSS feed

 
Pari Jeevanandam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a MDB process which read messages, process it and post it to another queue consumed by downstream xpression application.

Whenever heavy load is coming our way, this downstream application is not able to consume it at the rate in which we are posting, causing latency to its interfacing applications.

We need a solution to throttle message at our end.

So the question here is how do you slowdown that rate at which MDB process consumes messages.

Our solution is to stop our MDB from consuming message from queue by invoking Thread.sleep(for some time) after reaching some threshold (which is safe for our downstream application).

But this design has its own flaw, what if thread is not getting resumed. How do you manage it?

Also is there any other better mechanism to handle this without even using thread.sleep().

This is kind of urgent, any help will be very much appreciated. Thanks.

Application is on weblogic
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

It's not the code which you need to change. Typically message destination providers allow a way to "delay the delivery" of the messages to the listeners. You'll have to check the documentation of the messaging provider you are using to see how it can be configured.
 
Pari Jeevanandam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the direction, my application is sending message to MQ version less than 8. Below link gives details on how to delay in MQ8(JMS2.0) http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q119200_.htm
I would like to know how we can achieve this in MQ 6 or 7
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!