I have extracted the following from one of my working applications:
gmo.matchOptions = MQC.MQMO_NONE;
gmo.options =
MQC.MQGMO_FAIL_IF_QUIESCING
| MQC.MQGMO_BROWSE_NEXT
| MQC.MQGMO_ACCEPT_TRUNCATED_MSG;
try {
queue =
qMgr.accessQueue(
qName,
MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_BROWSE | MQC.MQOO_FAIL_IF_QUIESCING);
while(true) {
try {
queue.get(message, gmo);
}
catch (MQException e) {
....
}
}