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 segmentation problem

Post new topic  Reply to topic
 message segmentation problem « View previous topic :: View next topic » 
Author Message
maheswarank
PostPosted: Wed Jan 23, 2002 4:19 am    Post subject: Reply with quote

Newbie

Joined: 21 Jan 2002
Posts: 6

hi there

i am also having the same problem in message segmenting, i am not able to put a segmented message, even if i try putting it the groupid which i set before putting the message, is null when i get the message.
i have given the program in which i try to put a single message of a group,
but when i use this line in my program
myMessage.messageFlags = MQC.MQGS_MSG_IN_GROUP;
i get a run time error # 2249(MQRC_MSG_FLAGS_ERROR).

i would be grateful if anyone can guide me, in this problem



import com.ibm.mq.*;
public class messageput
{
public static void main(String a[]) throws Exception
{
MQEnvironment.hostname = "c-520";
MQEnvironment.channel = "SYSTEM.DEF.SVRCONN";
MQEnvironment.port = 1414;
MQQueueManager qmgr = null;

try
{
qmgr = new MQQueueManager("god");
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;
MQQueue queue = qmgr.accessQueue("Devil", openOptions, null, null, null);

String grp = "Group 1: 001";
MQMessage myMessage = new MQMessage();

myMessage.groupId = grp.getBytes();
//myMessage.messageFlags = MQC.MQGS_MSG_IN_GROUP;
System.out.println("Group ID : " + new String(myMessage.groupId));

String name = "1.1 mess";

myMessage.writeString(name);

MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options = MQC.MQPMO_LOGICAL_ORDER;

queue.put(myMessage,pmo);

myMessage = new MQMessage();
queue.put(myMessage,pmo);
queue.close();
qmgr.disconnect();
}

catch (MQException ex)
{
System.out.println("An MQSeries error occurred : Completion code " + ex.completionCode + " Reason code " + ex.reasonCode);
}

catch (java.io.IOException ex)
{
System.out.println("An error occurred whilst writing to the message buffer: " + ex);
}
}
}
Back to top
View user's profile Send private message
EddieA
PostPosted: Wed Jan 23, 2002 1:38 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Hi,

MQC.MQGS_MSG_IN_GROUP is only an Output flag according to the Java manual. It is set when a message belonging to a group is read.

Hmmmm. Perhaps IBM didn't implemented Groups as an extension to the 'standard' JMS specification.

Cheers,

_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
StefanSievert
PostPosted: Wed Jan 23, 2002 4:11 pm    Post subject: Reply with quote

Partisan

Joined: 28 Oct 2001
Posts: 333
Location: San Francisco

Eddie is right with his hint, even if your code doesn't look like it's using JMS. You should also check Chapter 8 of the manual MQSeries Using Java, which talks about platform specific fields and methods. messageFlags is not part of the core. But this might not be relevant to you.
May I add that you are referring to segmented messages, but your code looks like you want to achieve message grouping, which is the opposite.
Anyway, just a thought.
Stefan

_________________
Stefan Sievert
IBM Certified * MQSeries

[ This Message was edited by: StefanSievert on 2002-01-23 16:12 ]
Back to top
View user's profile Send private message
maheswarank
PostPosted: Wed Jan 23, 2002 6:40 pm    Post subject: Reply with quote

Newbie

Joined: 21 Jan 2002
Posts: 6

yup, the heading should have been related to message grouping not segmentation.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » message segmentation problem
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.