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 » WebSphere Message Broker (ACE) Support » Retaining a message's filename when sending it through queue

Post new topic  Reply to topic
 Retaining a message's filename when sending it through queue « View previous topic :: View next topic » 
Author Message
darioo
PostPosted: Thu Mar 19, 2009 3:19 am    Post subject: Retaining a message's filename when sending it through queue Reply with quote

Novice

Joined: 19 Mar 2009
Posts: 15

Greetings! I'm fairly new to MQ and MB, so please bear with me.

I have two machines, A and B, and I need to transfer some (small)
files from A to B. I'm using Message Broker for this task. On
A, I have set up a message flow that has two nodes:

Code:
FileInput -> MQOutput


On B, I have another message flow:

Code:
MQInput -> FileOutput


It's pretty obvious what I'm doing: reading a file on A, sending
it as a message to a queue on A and transferring that message to a
queue on B that's being read by a FileOutput node and written
somewhere on B's file system.

But I have a problem, because the file name is lost and I don't
know how to keep it.

When doing a local file transfer (FileInput -> FileOutput), the file
name is retained and read from
$LocalEnvironment/Destination/File/Name, but when transferring across
machines, it's empty...

I have read that there are possibilities of using reference messages
and channel exits just by using MQ, but I'd avoid that if I can.
Also, we can't use FTP transfer, so as you see, I don't have many
options.

It would be nice if I could do it in a straightforward way
without using any hacks. Putting a JavaNode in each message flow and
then writing & reading the file name directly into the message,
putting it somewhere in $LocalEnvironment, and deleting the file name
afterwards is one, but very hackish and ugly possibility.

Also, we're using the BLOB format, so no MRM or stuff like that...

Thanks in advance for your help!
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Thu Mar 19, 2009 3:28 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

I'd add an element in an RFH2 header in Flow A to store the filename which is then read by Flow B.

Something like:
SET OUTPUTROOT.MQRFH2.usr.FileName = 'Filename';

will do it.


You have to set other fields in Flow A to create a valid RFH2 header, if you do a search for MQRFH.Field you should find some useful stuff.

Heres a starter for 10:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ac16910_.htm

you dont need the psc folder though.


Last edited by WMBDEV1 on Thu Mar 19, 2009 3:38 am; edited 1 time in total
Back to top
View user's profile Send private message
MQEnthu
PostPosted: Thu Mar 19, 2009 3:37 am    Post subject: Reply with quote

Partisan

Joined: 06 Oct 2008
Posts: 329
Location: India

darioo wrote:
When doing a local file transfer (FileInput -> FileOutput), the file
name is retained and read from
$LocalEnvironment/Destination/File/Name, but when transferring across
machines, it's empty...


The values stored in local environment tree persist until the message flow goes out of scope..
_________________
-----------------------------------------------
It is good to remember the past,
but don't let past capture your future
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Mar 19, 2009 4:14 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

MQEnthu wrote:
darioo wrote:
When doing a local file transfer (FileInput -> FileOutput), the file
name is retained and read from
$LocalEnvironment/Destination/File/Name, but when transferring across
machines, it's empty...


The values stored in local environment tree persist until the message flow goes out of scope..


The values stored in LocalEnvironment persist until the message flow goes out of scope OR until some Transformation node does NOT copy them to OutputLocalEnvironment, whichever comes FIRST.
Back to top
View user's profile Send private message
MQEnthu
PostPosted: Thu Mar 19, 2009 5:04 am    Post subject: Reply with quote

Partisan

Joined: 06 Oct 2008
Posts: 329
Location: India

mqjeff wrote:
The values stored in LocalEnvironment persist until the message flow goes out of scope OR until some Transformation node does NOT copy them to OutputLocalEnvironment, whichever comes FIRST.





Oops!! I should have thought it while answering
_________________
-----------------------------------------------
It is good to remember the past,
but don't let past capture your future
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Mar 19, 2009 6:34 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Using the MQRFH2 usr folder is the way to go.
Don't forget to setup the MQMD.format & the MQRFH2 fields correctly though otherwise it won't get read correctly.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
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 » WebSphere Message Broker (ACE) Support » Retaining a message's filename when sending it through queue
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.