Browse, read, and remove a message from a queue using IBM MQ classes
Solution:
Here the solution I'm really looking for:
// set te cursor to remove the message from the queue
gmo.options = CMQC.MQGMO_MSG_UNDER_CURSOR;
queue.get(theMessage, gmo);
these lines have to be inserted in the question code
I've found it here: http://www.velocityreviews.com/forums/t124676-mq-series-messages-browse-and-delete.html