|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Tricky Question |
« View previous topic :: View next topic » |
Author |
Message
|
weetey |
Posted: Mon Jul 29, 2002 2:31 am Post subject: Tricky Question |
|
|
Newbie
Joined: 29 Jul 2002 Posts: 1
|
hello all, i'm a new learner in MQ.
was playing around with it and i have one question.
if i sent a file as a message, would it be possible to retrieve the file name at the other end?
cheers
wt |
|
Back to top |
|
 |
arinduer |
Posted: Mon Jul 29, 2002 4:38 am Post subject: |
|
|
 Acolyte
Joined: 13 Aug 2001 Posts: 50 Location: Phuket, Thailand
|
Yes. But we need more information. I suppose you can try browsing the message on the other system using the sample IBM program: amqsbcg located at /opt/mqm/samp/bin
The way to use it is like this:
/opt/mqm/samp/bin/amqsbcg NAME.OF.QUEUE NAME.OF.QMGR
amqsget does a destructive read and amqsput will put a message on the queue.
People often modify the code to handle bigger messages.
HTH... |
|
Back to top |
|
 |
bduncan |
Posted: Mon Jul 29, 2002 6:10 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
People typically transfer files via MQSeries by reading the file into a byte array, and passing this as the message body. However, this won't capture the attributes of the file, like the name, modified date, etc.
There are a few ways around it, and I've personally gotten the following methods to work-
1) Store the filename in the MsgType or CorrelId fields in the message header.
2) Set aside a fixed number of bytes at the start of the message body for this information. In other words, use the first 1024 bytes to store filename, attributes, etc., and then at position 1025, start writing out the byte array that contains the file itself. On the receiving side, after the MQGET, read the first 1024 bytes of the message, and use this information to reconstruct the file's name, attributes, and then read everything after this to reconstruct the actual file. _________________ 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
|
|
|
|