Page 1 of 1

Sending files to MQ

Posted: Thu Apr 15, 2010 1:52 am
by SBSA_DW2
Well, after searching for related topics I found this viewtopic.php?p=361392#361392

I want to send a zip file to MQ but am struggling to define the source to the MQ stage. If it's a compressed file, what do I specify in the sequential stage for the metadata? (original file is XML, but larger than life, thus the reason to compress the file before placing it on the Q)

Any other ideas on getting the zipped file onto the Q?

thanks guys

Posted: Thu Apr 15, 2010 11:07 am
by eostic
Not sure if DataStage will be the right way to go here.....there really isn't a regular way to "lift" a whole file and send it down a link........the only way to get something to the MQ Stage is to represent it as a "column" in DS....your zip file is likely to run into all kinds of issues related to data types, its' length, etc.

...but....for what it's worth, you might consider seeing if the Server Folder Stage can lift it...it was designed for picking up whole files, though usually for pure text purposes (such as entire XML documents). How big is big? DS itself probably won't be happy with a column that is more than a few hundred meg.....was it a Queue size issue?

I'll leave other DS experts to comment, but there may be ways in Enterprise Edition to exploit the External Source Stage, or perhaps a custom Operator or BuildOp.......and in the most recent releases, the Connectors [MQ Connector included] support more intelligent transfer of binary data by reference (was put in there for limited BLOB type support)....but it's not for the faint-of-heart and not something I know if you can tap into in custom fashion...

This may be one better suited to scriptinig at the command line.

Have you considered MQ 7's own File Transfer options?

Ernie

Posted: Thu Apr 15, 2010 12:02 pm
by ArjunK
You can try using the server folder stage with MQ. I have done that with text files and know that it works. Have never done zip files though!

Posted: Fri May 21, 2010 6:39 am
by SBSA_DW2
Thanks for that advice. I tried the Folder stage and unfortunately it did not work sending the zipped file.

Posted: Thu Sep 16, 2010 2:32 pm
by deepbanerji
SBSA_DW2 wrote:Thanks for that advice. I tried the Folder stage and unfortunately it did not work sending the zipped file.
I am actually encrypting the zip file with base64 and writing to MQ.

Folder stage - Transformer - MQ
(XML - zip - base64)

Posted: Thu Sep 16, 2010 3:24 pm
by eostic
Cool. Just curious --- what did you use for the base64 conversion?

Ernie

Posted: Fri Oct 08, 2010 9:23 am
by deepbanerji
Download and have the base64 utility in our box/folder. use the command base64 -e filename.zip filename