Spring JMS: how to stop and restart a MDP

Sometimes if you working on system integration may be useful to implement a JMS queue to make asynchronous calls to other applications or software components.

More than one time it happened to me that I needed to stop message consumers of the queue, and later I needed to restart it.