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 » Writing message to queue from file

Post new topic  Reply to topic
 Writing message to queue from file « View previous topic :: View next topic » 
Author Message
saturn_cemk
PostPosted: Wed Apr 11, 2007 10:16 pm    Post subject: Writing message to queue from file Reply with quote

Novice

Joined: 10 Jul 2006
Posts: 16

Hi all,

I have a message (containing the headers and body) which is stored in a text file. Now I want to write this message to an MQ queue. For doing this I want to write a small piece of code in java.

I could manage to read the entire file and store it in a String or byte array. But I need to convert the String / byte array to MQMessage before I can write it to the queue without changing the headers.

How can I do this ? Is there any way to convert a String / byte array to MQMessage ?

Any help will be appreciated.

Thank you
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Thu Apr 12, 2007 12:11 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

have a look at some of the samples here http://www.capitalware.biz/mqseries.html

there must be something there that fits your needs
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
saturn_cemk
PostPosted: Thu Apr 12, 2007 3:07 pm    Post subject: Reply with quote

Novice

Joined: 10 Jul 2006
Posts: 16

Thanks for the link Michael. It really helped.
Back to top
View user's profile Send private message
EZHIL MALAR
PostPosted: Thu Jan 22, 2009 4:00 am    Post subject: Reply with quote

Newbie

Joined: 20 Mar 2007
Posts: 8

saturn_cemk wrote:
Thanks for the link Michael. It really helped.



How did you do it????
I have a similar case
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jan 22, 2009 4:04 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It's exactly as simple as reading the file data, and then writing the bytes from the file into the body of an MQ Message.
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 » Writing message to queue from file
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.