Author |
Message
|
masteringmq |
Posted: Sun Nov 02, 2008 1:46 am Post subject: MQ Browse |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
The code below compiles well. I am getting error 2033. I check QM1.RQSTIN and found that the local queue is not empty. Please advice.
public boolean done = false;
qMgr = new MQQueueManager("QM5");
int openOptions = MQC.MQOO_INPUT_EXCLUSIVE | MQC.MQOO_BROWSE;
MQQueue MQ1_RQSTIN = qMgr.accessQueue("QM1.RQSTIN",openOptions);
MQMessage retrievedMessage = new MQMessage();
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_FIRST;
do
{
MQ1_RQSTIN.get(retrievedMessage,gmo);
String msg = retrievedMessage.messageId.toString();
System.out.println(msg);
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_NEXT;
}while(!done);
MQ1_RQSTIN.close();
qMgr.disconnect();
}
catch (MQException ex)
{
done = true;
System.out.println("A WebSphere MQ error occurred : Completion code " + ex.completionCode + " Reason code " + ex.reasonCode);
} |
|
Back to top |
|
 |
Vitor |
Posted: Sun Nov 02, 2008 2:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
If the queue's QM1.RQSTIN and you're connected to QM5 how's it supposed to work? Are you trying to read a remote queue (which won't work)?
Assuming that you're trying to read a conventional local queue, how are you checking it's not empty? It sounds like your target message is uncommitted and ineligable to be used, but still shows up on the queue. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Sun Nov 02, 2008 2:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
If the queue's QM1.RQSTIN and you're connected to QM5 how's it supposed to work? Are you trying to read a remote queue (which won't work)?
Assuming that you're trying to read a conventional local queue, how are you checking it's not empty? It sounds like your target message is uncommitted and ineligable to be used, but still shows up on the queue. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
masteringmq |
Posted: Sun Nov 02, 2008 2:10 am Post subject: |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
QM1.RQSTIN - local queue belonging to the queue manager QM5. In this local queue there is X number of messages. To know if the queue is empty I issue the MQSC command DISPLAY QLOCAL(QM1.RQSTIN) and check the currentdepth. In my case there is 5 messages. |
|
Back to top |
|
 |
atheek |
Posted: Sun Nov 02, 2008 2:46 am Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
Do dis qs(QM1.RQSTIN) UNCOM. If you see UNCOM(YES) then the messages in the queue are uncommitted ones. Uncommitted messages wont be able to an application even though it shows up in the queue count |
|
Back to top |
|
 |
masteringmq |
Posted: Sun Nov 02, 2008 3:21 am Post subject: |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
DIS QS(QM1.RQSTIN) UNCOM
1 : DIS QS(QM1.RQSTIN) UNCOM
AMQ8450: Display queue status details.
QUEUE(QM1.RQSTIN) TYPE(QUEUE)
CURDEPTH(1) UNCOM(NO) |
|
Back to top |
|
 |
atheek |
Posted: Sun Nov 02, 2008 4:07 am Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
Reset the matchOptions after each mq get in the loop:
do
{
MQ1_RQSTIN.get(retrievedMessage,gmo);
String msg = retrievedMessage.messageId.toString();
System.out.println(msg);
gmo.matchOptions=MQC.MQMO_NONE;
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_BROWSE_NEXT;
}while(!done); |
|
Back to top |
|
 |
masteringmq |
Posted: Sun Nov 02, 2008 5:09 am Post subject: |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
messageId retrieved: B@1cfb549
I did some convertion:
414D5120514D31202020202020202020CDA30D4920002002 |
|
Back to top |
|
 |
atheek |
Posted: Sun Nov 02, 2008 11:55 am Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
masteringmq wrote: |
messageId retrieved: B@1cfb549
I did some convertion:
414D5120514D31202020202020202020CDA30D4920002002 |
So what does that mean? Did it solve your 2033 issue? |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Nov 02, 2008 12:43 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I doubt it. Just to be secure I would also clear the msgid and correlid before each get... just set them to MQMI_NONE and MQCI_NONE....  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|