|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
message grouping using base java api on windows |
« View previous topic :: View next topic » |
Author |
Message
|
desinus |
Posted: Tue Dec 10, 2002 3:55 pm Post subject: message grouping using base java api on windows |
|
|
Newbie
Joined: 10 Dec 2002 Posts: 6 Location: US
|
Hello all,
I tried message grouping using base java api however, I don't seem to be getting any message back using the get api. This is how I do it,
--------- PUT ---------------
int PUT_OPEN_OPTIONS = MQC.MQOO_OUTPUT | MQC.MQOO_SET;
qMgr = new MQQueueManager(qManager);
MQQueue sendQueue = qMgr.accessQueue(sendQ, PUT_OPEN_OPTIONS,
null, null, null);
MQMessage msg = new MQMessage();
pmo.options = MQC.MQPMO_LOGICAL_ORDER;
msg.messageFlags = MQC.MQMF_MSG_IN_GROUP;
msg.writeString("1");
sendQ.put(msg, pmo);
msg.clearMessage();
msg.messageFlags = MQC.MQMF_MSG_LAST_IN_GROUP;
msg.writeString("2");
sendQueue.put(msg, pmo);
sendQueue.close();
qMgr.disconnect();
------------------- GET ----------------
int GET_OPEN_OPTIONS = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE | MQC.MQOO_SET;
qMgr = new MQQueueManager(qManager);
MQQueue getQueue = qMgr.accessQueue(receiveQ, GET_OPEN_OPTIONS, null, null, null);
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options = MQC.MQGMO_WAIT | MQC.MQGMO_LOGICAL_ORDER | MQC.MQGMO_ALL_MSGS_AVAILABLE;
gmo.waitInterval = 1000;
getQueue.get(msg, gmo, size);
msgText = msg.readString(msg.getTotalMessageLength());
getQueue.close();
qMgr.disconnect();
--------------------------------------------------------------------------
On printing the messages that I send in the group I noticed that the message id and group id for each of the messages was different.
I am not sure what I do wrong. I would appreciate it if someone could tell me the problem in my code. Thanks in advance. |
|
Back to top |
|
 |
desinus |
Posted: Wed Dec 11, 2002 6:21 am Post subject: message grouping using base java api on windows |
|
|
Newbie
Joined: 10 Dec 2002 Posts: 6 Location: US
|
To add to my previous post, I changed my code in the put part as follows,
Hello all,
I tried message grouping using base java api however, I don't seem to be getting any message back using the get api. This is how I do it,
--------- PUT ---------------
int PUT_OPEN_OPTIONS = MQC.MQOO_OUTPUT | MQC.MQOO_SET;
qMgr = new MQQueueManager(qManager);
MQQueue sendQueue = qMgr.accessQueue(sendQ, PUT_OPEN_OPTIONS,
null, null, null);
MQMessage msg = new MQMessage();
pmo.options = MQC.MQPMO_LOGICAL_ORDER;
msg.messageFlags = MQC.MQMF_MSG_IN_GROUP;
msg.writeString("1");
sendQ.put(msg, pmo);
//msg.clearMessage(); don't created the object buffer
msg.messageFlags = MQC.MQMF_MSG_LAST_IN_GROUP;
msg.writeString("2");
sendQueue.put(msg, pmo);
sendQueue.close();
qMgr.disconnect();
The message id and group id stay the same and the message sequence number does not increment i.e. displays a value of 1 for each of the messages.
Thanks in advance.
D |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Dec 11, 2002 10:47 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Your put code looks similar to what I have coded up. Your get code is different from mine. Is it not getting the messages because they are not part of the group? Have you run amqsbcg against the queue to see what it thinks the group information is for the message?
Also, check your private messages..... |
|
Back to top |
|
 |
desinus |
Posted: Thu Dec 12, 2002 12:55 pm Post subject: message grouping using base java api on windows |
|
|
Newbie
Joined: 10 Dec 2002 Posts: 6 Location: US
|
I got this issue resolved. Thanks a lot Ron for the examples you sent me. It helped me a lot. I was looking to use message id to correlation id mapping on the grouped messages and could do that. I also tried out segmentation and that worked flawlessly too.
Thanks once again. |
|
Back to top |
|
 |
bduncan |
Posted: Thu Dec 12, 2002 1:33 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Hey everyone, let's try to stay away from posting the same question in multiple forums (usually in order to attract more attention to the question). This is the result of that. Responses are fractured and it's difficult to understand the entire thread without knowing the location of both posts... _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
Mohit Gupta |
Posted: Thu Sep 16, 2004 2:14 am Post subject: message grouping/segment using base java api on windows |
|
|
Apprentice
Joined: 16 Sep 2004 Posts: 34
|
Can anybody send me the code how to do it?? |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Sep 16, 2004 6:30 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|