How to stop message processing before undeploying?
Given: A JMS message queue. A timer service which puts messages to that queue periodically (from a database). A JEE6 message-driven bean which reads from the queue. The timer service and the message-driven bean are part of different deployment units. Problem: The message-driven bean cannot be undeployed, without breaking the workflow state, as long as messages are work in process. Because of that, we stop the timer service first and wait until all messages are finished. Is there a way to automate that behavior? Or is it possible to prevent undeployment if the timer service is still running? We