|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to transfer Image files like jpeg/mpeg files via MQ |
« View previous topic :: View next topic » |
Author |
Message
|
murthyps |
Posted: Tue Mar 18, 2003 3:13 pm Post subject: How to transfer Image files like jpeg/mpeg files via MQ |
|
|
Newbie
Joined: 18 Mar 2003 Posts: 2
|
We have to use MQ series as transport mechanism to transfer image files From/To NT To/From AS400 and . Can some one tell me how to do this. |
|
Back to top |
|
 |
mqonnet |
Posted: Tue Mar 18, 2003 7:39 pm Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
You need to write a message exit using reference messages to achieve this. I dont think there is any other way out other than this.
Cheers
Kumar _________________ IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator |
|
Back to top |
|
 |
RogerLacroix |
Posted: Tue Mar 18, 2003 9:35 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
Transfer the files the same way as you would any other file except that the content is binary data. Also, mark the MQMD.Format equal to NONE.
If the file(s) are larger than 100MB then you should use message grouping.
later
Roger... _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
mqonnet |
Posted: Wed Mar 19, 2003 6:07 am Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
Roger, could you please give an example of how to transfer files as is.
Because my assumption was there are only 2 ways to do this.
1) Read the file into a stream buffer and add it to the MD and send it accross. This would work fine in the case of text files, but i was bit hazy about files such as jpeg which highly depend on the resolution, pixels etc. Not sure if writing code this way would help in this scenario. Please comment.
2) Message exit using reference message is always the best and the easy option, per my understanding. Because the overhead of the app programmer reduces just to write an exit.
Cheers
Kumar _________________ IBM Certified WebSphere MQ V5.3 Developer
IBM Certified WebSphere MQ V5.3 Solution Designer
IBM Certified WebSphere MQ V5.3 System Administrator |
|
Back to top |
|
 |
JohnMN |
Posted: Wed Mar 19, 2003 7:58 am Post subject: |
|
|
Novice
Joined: 26 Feb 2003 Posts: 19
|
A jpeg file is simply a stream of bits and bytes, the same as any other file. Sending a jpeg file via MQ is no different than sending the same file via FTP, or copying it to another directory, or burning it onto a CDROM.
A few years back, I wrote an MQ-based file transfer program that successfully transferred text and binary files. It was not at all difficult.
You just read the bytes of data from the file, put them into a buffer, and send them as the data of an MQ message. The receiving program (and QMgr) need to know that it is binary data, so that they don't try to do any character code translation. The receiving program simply retrieves the message data into a buffer, and writes it to a new file.
The only part that might be challening is dealing with the AS/400, because it has its own unique file system. But the MQ part is very straighforward.
The only time the pixels and resolution are an issue is when the initial jpeg image is created, or when a program tries to display the jpeg image.
In my opinion, writing an exit would add another level of complexity. For one thing, installing an exit requires Admin changes. It is much simpler to write all of the code for one self-contained executable file.
John |
|
Back to top |
|
 |
bduncan |
Posted: Wed Mar 19, 2003 12:12 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
John is completely right. MQSeries is a transport mechanism. It doesn't concern itself with the contents of a message, aside from the need to do a character set conversion in some cases. Quite a while back, I wrote a perl program that would read a jpeg file from disk, break it into 16kb chunks, place each chunk in a message, and put the messages to a remote queue using logical grouping. The final message in the group would contain information about the file itself, like the filename, ownership, permission bits, etc., things which aren't captured by the file's data. This way, a perl program on the remote machine could perfectly reconstruct the image file. _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
murthyps |
Posted: Mon Mar 24, 2003 8:50 am Post subject: Thanks |
|
|
Newbie
Joined: 18 Mar 2003 Posts: 2
|
Thanks to evryone who gave ideas. We are planning to go ahead with the Reference message path, which can resolve the AS400 related issues like file types & Message size size etc...I really appreciate your input.
Vasu |
|
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
|
|
|
|