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 » javax.jms.TextMessage messages truncated

Post new topic  Reply to topic
 javax.jms.TextMessage messages truncated « View previous topic :: View next topic » 
Author Message
hzhuang
PostPosted: Tue Aug 08, 2006 3:29 am    Post subject: javax.jms.TextMessage messages truncated Reply with quote

Newbie

Joined: 08 Aug 2006
Posts: 1

I use the following code to instantiate IBM MQ and create a text message

MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
factory.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
factory.setQueueManager(qcf_jndiName);
factory.setHostName(queueManagerHost);
factory.setPort(queueManagerPort);
factory.setChannel(channel_jndiName);

qcon = factory.createQueueConnection();

qcon.start();

qsession = qcon.createQueueSession(false,
javax.jms.Session.AUTO_ACKNOWLEDGE);
queue = qsession.createQueue("queue:///" + queueName +
"?targetClient=0");
TextMessage textMsg = qsession.createTextMessage(reply);
System.out.println("$$$Msg after qsession" + textMsg);

From System.out.println statement, I found that textMsg only takes the first 100 characters of reply. Would you share your solution with us?
Thanks
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Aug 08, 2006 5:56 am    Post subject: Reply with quote

Jedi Knight

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

Where does 'reply' come from? How is it defined?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
fjb_saper
PostPosted: Tue Aug 08, 2006 2:23 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Do not use:
Quote:
System.out.println("$$$Msg after qsession" + textMsg);

Use instead
Code:
 System.out.println("$$$Msg after qsession" + textMsg.getText());


Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » javax.jms.TextMessage messages 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.