MQ and XML Stages.

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
mrvsr
Premium Member
Premium Member
Posts: 40
Joined: Fri Aug 03, 2007 8:33 am

MQ and XML Stages.

Post by mrvsr »

Hi All,

Please help me in designing my jobs for below requirement. we have to read XML messages like below from message queue continuously <Root> <Header><table>emp</table><empcount>12</empcount></Header> <Detail><empno>111</empno><empno>222</empno>..........</Detail></Root>. Job should be started and waiting for the messages If there is a message in the message queue it should create a sequential file with all employee numbers in the queue and wait for one more message to arrive. Like that it should keep running and create sequential files with timestamp suffix. Please let me know which stages should I use and How can I execute the job continuously(without using sequences).
Thanks
MRVSR
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Snapping out the sequential files separately will be a challenge, because the job resloves filenames (using the normal sequential stages) at start up time....

What's your message frequency? (how often do messages arrive?)....

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
mrvsr
Premium Member
Premium Member
Posts: 40
Joined: Fri Aug 03, 2007 8:33 am

MQ and XML Real time stages

Post by mrvsr »

Hi Ernie,

Messages may arrive at every 2 minutes interval are more.
Please let me know how can we allocate file names dynamically.

Thanks
mrvsr.
Thanks
MRVSR
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Flat files once opened are a bear to manage in a real-time Job, because the Job doesn't "let go" of the file until it is complete, and "real time" jobs stay running, with files "open.". While there might be some tricks you could use, most times I've seen games played with flat files it's like playing with fire --- too many chances to get burnt, and other solutions (javaPack or custom Operator) involve a lot more complexity.

If your messages arrive "in two minute intervals", then have the job time-out after waiting 10 seconds and then get launched again. If it's a monsterous job and takes forever to load up into memory that could be an issue, but if not, it's the simplest, albeit not the most elegant solution.

Alternatively, I was thinking about the XMLOutput Stage, which has the ability to "snap" new files with appended index value in their names (don't put an output link on the Stage -- and specify the xml document filename in the appropriate property). Could be an interesting trick there, but you'll have to play around a lot with the XMLOutput Stage to get it to produce the file format you are looking for. It may still force you to have at least "some" tagging surrounding your data. But it might be close enough to what you need to make it worthwhile.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
mrvsr
Premium Member
Premium Member
Posts: 40
Joined: Fri Aug 03, 2007 8:33 am

Post by mrvsr »

Hi Ernie,

I used XML output stage. I didnt give any output link. I got stage options write to an output file option But in file path I can only select static file name.
Please let me know how give index or any dynamic value in the filename.
Thanks
MRVSR
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You put in your 'static' filename and then specify the Trigger Column attribute there as well. Every time the value in that column changes, you get a new file with an increasing number appended to it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply