|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQ Java send file |
« View previous topic :: View next topic » |
Author |
Message
|
masteringmq |
Posted: Tue Oct 21, 2008 9:12 am Post subject: MQ Java send file |
|
|
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 |
|
 |
David.Partridge |
Posted: Tue Oct 21, 2008 11:16 pm Post subject: |
|
|
 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 |
|
 |
masteringmq |
Posted: Wed Oct 22, 2008 2:53 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|