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 » JMS message getting truncated

Post new topic  Reply to topic
 JMS message getting truncated « View previous topic :: View next topic » 
Author Message
cmh
PostPosted: Fri Nov 07, 2003 7:03 am    Post subject: JMS message getting truncated Reply with quote

Newbie

Joined: 07 Nov 2003
Posts: 2
Location: MI

I am having JMS trivial message reading program, which is truncating the message to 100 characters, the actual message size is 102500 bytes.
code is:
env.put(Context.INITIAL_CONTEXT_FACTORY,initialContextFactory);
env.put(Context.PROVIDER_URL,providerURL);
jndiContext =new InitialContext(env);
// Get JNDI objects
queueConnectionFactory =(QueueConnectionFactory)jndiContext.lookup(qcfName);
queue =(Queue)jndiContext.lookup(queueName);
//Get Connection from factory
queueConnection =queueConnectionFactory.createQueueConnection();
//Start connection
queueConnection.start();
//Create Session
queueSession=queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
//Create Message consumer
queueReceiver=queueSession.createReceiver(queue);
boolean eom=true;
while (eom){
Message m=queueReceiver.receive();
if (m instanceof TextMessage){
System.out.println("Testing -> 111111122223333 <----"+m.toString());
}
}

Do I need to set message length?
IBM java API program retrieves the complete message without any problem.

Thanks in advance
_________________
cmh
Back to top
View user's profile Send private message
kingdon
PostPosted: Mon Nov 10, 2003 12:24 am    Post subject: Reply with quote

Acolyte

Joined: 14 Jan 2002
Posts: 63
Location: UK

Message.toString() is just a convenience method intended for debug etc. If you want to get the message content then you need to use the type specific accessor methods, e.g. for TextMessage you would use the getText() method.

Regards,
James.
Back to top
View user's profile Send private message
cmh
PostPosted: Mon Nov 10, 2003 12:47 pm    Post subject: Reply with quote

Newbie

Joined: 07 Nov 2003
Posts: 2
Location: MI

Thanks. getText() worked.
_________________
cmh
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 » JMS message getting truncated
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.