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 » MQ Java send file

Post new topic  Reply to topic
 MQ Java send file « View previous topic :: View next topic » 
Author Message
masteringmq
PostPosted: Tue Oct 21, 2008 9:12 am    Post subject: MQ Java send file Reply with quote

Master

Joined: 20 Oct 2008
Posts: 200

To send a file:

1. Read the input file.
2. Append it into a StringBuffer object and write that object into the queue.
3. Read from the queue and write back the contents into a file

which I am successful. But how do I specify the destination filename to be the same as the source filename?.
Back to top
View user's profile Send private message
David.Partridge
PostPosted: Tue Oct 21, 2008 11:16 pm    Post subject: Reply with quote

Master

Joined: 28 Jun 2001
Posts: 249

Well, that might sort of work if the file isn't a binary file, and if the data is stream data, but certainly won't for a blocked file (e.g. on MVS), and as you rightly say you don't get to pass across the target DSN and other attributes.

That's because when all is said and done, MQ is not a file transfer product, it's a messaging engine. If you want to transfer files over MQ, there are whole products that sit on top of MQ ranging from free ones (e.g. Spazio XSP which is an MQ support pack), to full OEM products, and now the MQ File Transfer Edition (about which I know little).

You can design your own solution, but you are definitely re-inventing the wheel.
_________________
Cheers,
David C. Partridge
Back to top
View user's profile Send private message
masteringmq
PostPosted: Wed Oct 22, 2008 2:53 am    Post subject: Reply with quote

Master

Joined: 20 Oct 2008
Posts: 200

So it's best to step away from file transfer unless I decide to use tools like Tivoli Data Exchange that leverages MQSeries to do file transfer. But then there are classes like ObjectOutputStream and ObjectInputStream that can be used to read and write binary files. I was analyzing steps as to ensure how the destination filename can be the same as the source filename and I came up with the idea:

1. Specify a format or stucture of the file content
2. Use the message header

The first step sounds fine, but then not everyone is gonna send files using my standard format or stucture of file content. This is because files can be generated by a system and it can have any file format or stucture. Step 2 sounds promising But how? I found how
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 » MQ Java send 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.