ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » message grouping using base java api on windows

Post new topic  Reply to topic
 message grouping using base java api on windows « View previous topic :: View next topic » 
Author Message
desinus
PostPosted: Tue Dec 10, 2002 3:55 pm    Post subject: message grouping using base java api on windows Reply with quote

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
View user's profile Send private message
desinus
PostPosted: Wed Dec 11, 2002 6:21 am    Post subject: message grouping using base java api on windows Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Wed Dec 11, 2002 10:47 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
desinus
PostPosted: Thu Dec 12, 2002 12:55 pm    Post subject: message grouping using base java api on windows Reply with quote

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
View user's profile Send private message
bduncan
PostPosted: Thu Dec 12, 2002 1:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
Mohit Gupta
PostPosted: Thu Sep 16, 2004 2:14 am    Post subject: message grouping/segment using base java api on windows Reply with quote

Apprentice

Joined: 16 Sep 2004
Posts: 34

Can anybody send me the code how to do it??
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Sep 16, 2004 6:30 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

If you go to:

http://www.developer.ibm.com/tech/sampmq.html

you'll find a getgroup.c and a putgroup.c. You might want to look at them for starters. I can't find the code that I used earlier.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » message grouping using base java api on windows
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.