|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Getting message as a file. |
« View previous topic :: View next topic » |
Author |
Message
|
rajpath |
Posted: Tue Jun 18, 2002 10:21 pm Post subject: Getting message as a file. |
|
|
Novice
Joined: 12 Jun 2002 Posts: 12 Location: Mumbai
|
Hello friends
I am working on MQSeries with Java and am comfortable with the same.
If I put the message on the queue as File object through java can I get or retreive it through C or Visual Basic application??
I tried out with the built in programs with MQSeries but the entire picture is bit unclear about how to get file objects from VB or C?
The sample code specifies about putting and getting strings i.e.simple text but not files.
Can u please support 4 the same. _________________ Raj
Software Engineer
Mahindra Consulting Ltd
Mumbai-101 India |
|
Back to top |
|
 |
bduncan |
Posted: Wed Jun 19, 2002 9:32 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Raj,
There is no problem moving files around in MQSeries, even when you are using different programming languages on each end. However, I would recommend reading the file into Java as a binary stream, and then putting this into your message, rather than letting Java serialize the File object. This way, when your C or VB program receives the message, it can simply write the bytes to file, one by one.
I haven't done Java to C or VB, but I have done Perl to C, where the Perl program was reading a file from disk, sending it as a message to a queue where a C program would pick it up and reconstruct the file. _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
MillsPerry |
Posted: Fri Jun 21, 2002 12:28 pm Post subject: Java File Class In Message |
|
|
 Acolyte
Joined: 08 Oct 2001 Posts: 59 Location: ZyQuest, inc.
|
The problem with putting a Java file object into a message is that it would only be useable to another Java program. Other languages, such as Visual Basic or C++, don't have access to Java's object structure. Would it be possible to serialize the file object into an XML structure? |
|
Back to top |
|
 |
bduncan |
Posted: Fri Jun 21, 2002 1:14 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
It's relatively straightforward to pass the File object into a FileReader, and by using the read() method, you can get the file contents into a character array, which can be placed in an MQSeries message. VB and C provide similar methods/functions to do the inverse operation on the other side... _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
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
|
|
|
|