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 » Putting file in Queue..urgent

Post new topic  Reply to topic
 Putting file in Queue..urgent « View previous topic :: View next topic » 
Author Message
AmolArch
PostPosted: Thu Jan 27, 2005 7:50 pm    Post subject: Putting file in Queue..urgent Reply with quote

Newbie

Joined: 19 Jan 2005
Posts: 7

Hi,
I want to read a text file (SWIFT) and want to insert in a Queue.
for that I wrote
MQMessage msg=new MQMessage();
msg.format = MQC.MQFMT_STRING;
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));
String line = "";
while((line = br.readLine()) != null)
{
msg.writeString(line);
}

but then the data in queue will apear in single line.
How can we insert <CR><LF> after end of each segment.
can we write something line msg.writeString('\n')
Back to top
View user's profile Send private message Yahoo Messenger
clindsey
PostPosted: Fri Jan 28, 2005 5:20 am    Post subject: Reply with quote

Knight

Joined: 12 Jul 2002
Posts: 586
Location: Dallas, Tx

Did you try msg.writeString("\n") to see what might happen?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Jan 28, 2005 2:31 pm    Post subject: Reply with quote

Grand High Poobah

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

You need to use a printwriter to write to a string buffer
Then put the full string into the msg.

If it is too long use some stream method...

Enjoy
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 » Putting file in Queue..urgent
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.