vairam
vairam

Reputation: 471

Pause MDB message Processing

Can we pause the MDB message processing for some time? For example: Jboss 1-deployed MDB for message processing. Jboss 2:-Bean for gathering user details. If the MDB from jboss 1 calls bean in jboss 2 for getting users details. If this is the case, when we restart the Jboss 2, we need to pause the MDB in jboss 1 till the jboss 2 is UP. Is there any option to pause MDB, so that we can avoid failure of message?

Upvotes: 1

Views: 2971

Answers (3)

Clebert Suconic
Clebert Suconic

Reputation: 5383

You can stop the Queue on HornetQ. (I'm not sure about JBoss Messaging, but I'm pretty sure you do)

Look for the message pause and resume on the JMX Console

Upvotes: 0

GreenGiant
GreenGiant

Reputation: 5236

In JBoss (4.x and 5.x), you can look up the MDB through the JMX Console and pause delivery of messages.

  1. Go to the jmx console (http://yourserver:8080/jmx-console/ where 8080 is the HTTP port)
  2. Click jboss.j2ee in the left-hand pane
  3. In the right-hand pane, find and click on your MDB. Usually, it will look something like

    jar=file-containing-your-MDB.jar,name=NameOfYourMDB,service=EJB3

  4. To pause, click the "Invoke" button next to "stopDelivery"
  5. To resume, click the "Invoke" button next to "startDelivery"

Upvotes: 2

MaDa
MaDa

Reputation: 10762

I doubt you can stop an MDB without stopping the whole application. It is possible with Spring JMS, but not with regular message driven beans.

What you could do, and is apparently possible, is pausing a queue. HornetMQ does give you the possibility to switch the queue to "receive only mode", though I don't know if this is available via the admin console.

Upvotes: 2

Related Questions