Page 1 of 1

How can I get the message from MQ?

Posted: Thu Dec 20, 2007 12:43 am
by brigitta
Hi all,

I am new in MQ stage, I want to know how to get the MQ message.
At "column" tab, many options to get MQ message information at field "Data element", e.g. MQ.CORRID, MQ.DATE. But which one is for MQ message content itself?

Many thanks.

Cheers,
Brigitta

Posted: Thu Dec 20, 2007 1:35 am
by ray.wurlod
Welcome aboard.

Is this in a server job or in a parallel job?

(You have posted in the server job forum but marked your job type as parallel.)

Posted: Thu Dec 20, 2007 2:03 am
by brigitta
Hi Ray,

We will develop in both parallel and server jobs. Any different in getting MQ message content?

Cheers,
Brigitta

Posted: Thu Dec 20, 2007 11:16 am
by sunil_acc
you get 2 colums out of MQ!
1. Invocation ID
2. message!

the message is a whole long stream of message (say 25000 char long). You need to parse that message using some logic. What i have used is a XML stage to parse it and get the data in required format!

try it! :idea:

thanks
suunil

Posted: Thu Dec 20, 2007 8:19 pm
by brigitta
Hi suunil,

In MQ stage at "column" tab, many options to get MQ message information at field "Data element", e.g. MQ.CORRID, MQ.DATE. But in the list box, which one is for MQ message content itself?

thanks,
Brigitta

Posted: Fri Dec 21, 2007 9:28 am
by sunil_acc
Hi Brigitta,
I dont have the stage installed hence cant provide you the demo job, but as far as i remenber you dont have to give a description for the message (just define the data type and its size).

Moreover, are you reading from the MQ or you are writing to the MQ?

Also it will be good to go through the MQ guide present on the CLIENT DATASTAGE installation directory (usually C:\Program Files\Ascential\DataStage7.5.1\Docs). This will help you a lot, also its pretty small so it wont take much time.

I will still try to look to the stuff you asked for.

Thanks
Sunil

Posted: Fri Dec 21, 2007 6:09 pm
by eostic
As Sunil says, there really are only two columns to concern yourself with.....the message ID, which is there on the output link automatically, and whatever other columns you place on the link......these additional columns function much like the Sequential stage (on Server --- where the Display length is the offset in bytes into the message buffer)...however, the easiest and safest way to get the message is to just add one other column on the output link, like "myMessage"...give it a longvarchar datatype and a length of say.... 5000 and see what you get..... there are options in there for truncation and padding, if the message is shorter or longer.

Ernie