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 » A question in MQ-Java programming

Post new topic  Reply to topic
 A question in MQ-Java programming « View previous topic :: View next topic » 
Author Message
wildtiger
PostPosted: Tue May 07, 2002 6:01 am    Post subject: Reply with quote

Acolyte

Joined: 21 Apr 2002
Posts: 55
Location: Canada

I'm writing a MQ-Java program, which sends a group of messages. It prints out the groupId after putting a message. I've cheeck the groupIds of all messages are same using MQ Explorer. But the values of groupId printed in this program are different from each other. Could anyone tell me what's wrong with this program? How can I check groupId?

message.groupId = MQC.MQGI_NONE;
message.messageFlags = MQC.MQMF_MSG_IN_GROUP;

while ( (rl = fis.read(ch)) != -1 )
{
message.clearMessage();
message.writeString ( byte2String(ch) );
if ( rl != messageMaxLength )
message.messageFlags = MQC.MQMF_LAST_MSG_IN_GROUP;

queue.put ( message, pmo );
System.out.println ( "groupId = " + message.groupId );

}
Back to top
View user's profile Send private message
bduncan
PostPosted: Tue May 07, 2002 7:21 am    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

I think the message.clear is what is doing it. You should only be resetting the messageid and/or correlid fields in the message header, not the whole thing. This way, the groupid field remains set to the value that was assigned to the first message in the group.


_________________
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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » A question in MQ-Java programming
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.