PAUSING AN MDB

Dear Java Experts,

Kindly help me on how to stop an MDB from listning to an MQ Queue.

Env.

I have an remote MQ running in a different environment. I have deployed my MDB on a Weblogic 8.1 server. Using Forign JMS I am able to connect to the MQ.

Problem.

Due to some business reasons I had to pause my processing of the messages for a while and later resume the processing.

When this requirement came I tried to set some attribute on the context saying like MDBRUNNING="Y" then run otherwise throw a system Exception.

This solution is working fine but If we throw a system exception within some minutes the server LOG grows in MBs and we are forced to Stat the MDB.

Does the J2EE provide this feature? Can someone help me on this.

[784 byte] By [reflex2javaa] at [2007-10-2 14:33:48]
# 1

No, this behavior is not part of the J2EE specifications.It's possible for a particular J2EE implementation to support this feature, but there's no requirement to.

If it's not supported by your J2EE server vendor, you could attempt to implement it within your application.When you're in the pause-mode, you'd need to put the delayed messages on a different queue that is not automatically consumed.You'd then need to re-send them to the target consumer whenever you get out of pause mode.

--ken

ksaksa at 2007-7-13 12:57:27 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Dear Ken,Is there any where in the JMS I can stop a JMS queue to stop listening to messages from the MQ-Queue. So that MDB also stops for a while. This should be possible and I can see It as a common requirement. It should be apart of J2EE/JMS specification.
reflex2javaa at 2007-7-13 12:57:27 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

The JMS API allows the JMS connection to be stopped, which temporarily stops the inflow of messages through all sessions created via that connection. However, in J2EE the message-driven bean doesn't have access to the connection.There's nothing in the EJB spec that requires implementations to support the temporarily disabling of incoming messages. App servers can support it if they wish.

--ken

ksaksa at 2007-7-13 12:57:27 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
Ken,Is it that we need to do a code that is specific to any particular App Server. Say, should I use the Weblogic's API to pause an MDB? In my openion it looks like a dirty solution.
reflex2javaa at 2007-7-13 12:57:27 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5

> Ken,

> Is it that we need to do a code that is specific

> fic to any particular App Server. Say, should I use

> the Weblogic's API to pause an MDB?

>

> In my openion it looks like a dirty solution.

One more quick message for my previous reply.

I ment that if I had to use the App server's API there will not be any generic solution for the problem. If tomorrow we find the current App server that is used is dcomissioned then we need to migrate the entire sources. In my opinion I want to have an application(EAR) that can be deployed on any App server.

Kindly forgive me for the comment that was given for your suggession.

reflex2javaa at 2007-7-13 12:57:27 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6
No, it's really not something that the application should be doing. Ideally, it's a feature that would be available through an appserver's administration console.We have had requests to add this feature to SUN's appserver so it's something we're considering for a future release.
ksaksa at 2007-7-13 12:57:27 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 7
Hi, We are currently deploying our application on Weblogic 8.1 SP4 and there is a need for us to stop the MDB everyday or I may put it like this the MDBs should Run only during the business hours and stop otherwise.
reflex2javaa at 2007-7-13 12:57:27 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 8
Is anyone having a perfect solution that would help us solve this problem.
reflex2javaa at 2007-7-13 12:57:27 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 9
Yes. We stop the listner using PCF commands com.ibm.mq.pcf.* for WebSphere applications. I am not sure if Weblogic has any.
Dollera at 2007-7-13 12:57:27 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 10
Even than it would be better if we have it as a part of JMS Specification. So that we can have it standard accross all application servers.
reflex2javaa at 2007-7-13 12:57:27 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...