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 » MQMessage and TextMessage objects

Post new topic  Reply to topic
 MQMessage and TextMessage objects « View previous topic :: View next topic » 
Author Message
AndyJB444
PostPosted: Wed Nov 09, 2005 11:05 am    Post subject: MQMessage and TextMessage objects Reply with quote

Newbie

Joined: 03 Nov 2005
Posts: 4
Location: Washington D.C.

Hi,

In a Java App I'm trying to put TextMessage objects to a WMQ 5.1 queue. Currently, I can put plain strings on the queue ("mBuf.writeString(xml); "), but these do not have the MQHRF2 format or headers. Can I use the code structure below to utilize TextMessage objects somehow? Thanks!

Code:


MQQueueManager qMgr = new MQQueueManager(manager);
         int openOptions = MQC.MQOO_OUTPUT;
         System.out.println("MQmanager-access queue");
         MQQueue q = qMgr.accessQueue(queue, openOptions, null, null, null);
         MQPutMessageOptions pmo = new MQPutMessageOptions();
         pmo.options = MQC.MQPMO_NONE;
         MQMessage mBuf = new MQMessage();
         mBuf.clearMessage();
         mBuf.correlationId = MQC.MQCI_NONE; // this acts as filter when you browse the queue!
         mBuf.messageId = MQC.MQMI_NONE; // if MQMI not set, so everyone can use the queue
         mBuf.writeString(xml);
         System.out.println("put message to queue");
         q.put(mBuf, pmo);
         System.out.println("about to close");
         q.close();
         qMgr.disconnect();
Back to top
View user's profile Send private message AIM Address
bower5932
PostPosted: Wed Nov 09, 2005 12:21 pm    Post subject: Reply with quote

Jedi Knight

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

If you want the MQRFH2 header on your messages, you'll need to build itself or put your message with JMS. As far as WMQ is concerned, a 'MQSTR' format message is also a JMS TextMessage.
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 » MQMessage and TextMessage objects
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.