Sending files to MQ

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
SBSA_DW2
Premium Member
Premium Member
Posts: 37
Joined: Fri Jul 25, 2008 1:24 am

Sending files to MQ

Post 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
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post 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
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
ArjunK
Participant
Posts: 30
Joined: Sun Apr 30, 2006 6:32 pm

Post 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!
SBSA_DW2
Premium Member
Premium Member
Posts: 37
Joined: Fri Jul 25, 2008 1:24 am

Post by SBSA_DW2 »

Thanks for that advice. I tried the Folder stage and unfortunately it did not work sending the zipped file.
deepbanerji
Participant
Posts: 14
Joined: Fri Sep 03, 2004 2:50 pm
Location: NJ

Post 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)
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Cool. Just curious --- what did you use for the base64 conversion?

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
deepbanerji
Participant
Posts: 14
Joined: Fri Sep 03, 2004 2:50 pm
Location: NJ

Post by deepbanerji »

Download and have the base64 utility in our box/folder. use the command base64 -e filename.zip filename
Post Reply