• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Make MDB wait/sleep for sometime programmatically

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic