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.
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 >

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.
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 >

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.
> 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.
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 >
