Sunday, March 19, 2017

Suspending a MDB

It's easy to suspend consumption of JMS messages from a MDB with WLST (this code is from an Oracle Support document):
connect("username", "password", "t3://host:port")

The Java JMX version is horrendously more complicated.

Here they say:

“NOTE:Suspending One individual MDB from an EAR file is not possible so if your EAR application Contains multiple MDBs then you will have to suspend all the MDBs present in that EAR like above.”

but I am not really sure this is true, since there is a JMX method for this:

However if you restart WLS, the MDB will resume consumption.

If you use native WLS JMS, you can disable consumption on the JMS queue itself. This feature doesn't seem to be available for foreign JMS destinations (like MQ). In this case, you can simply comment out the destination in the JMS WLS configuration XML.... the MDB at startup will complain that it can't connect to the destination, but the application will still deploy. It's a horrible hack but it works

No comments: