Create a MDB(Message Driven Bean) and configure it to listen to the MQ port. The onMessage() method of MDB will be called by container when a message arrives. Do your processing in the onMessage() method of MDB.
So I left, I came home, and I ate some pie. And then I read this tiny ad: