Author |
Message
|
angka |
Posted: Wed Sep 06, 2006 7:31 pm Post subject: MQInput node |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi all,
Is there a way to dynamically set the MQInput Node>Default>Message Type value? or is there a why to set it before it pick up from queue? Thanks
Rgds |
|
Back to top |
|
 |
vennela |
Posted: Wed Sep 06, 2006 9:46 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
I think you can set this in your RFH2 but I would want somebody else to confirm this |
|
Back to top |
|
 |
sebastianhirt |
Posted: Wed Sep 06, 2006 10:40 pm Post subject: |
|
|
Yatiri
Joined: 07 Jun 2004 Posts: 620 Location: Germany
|
vennela wrote: |
I think you can set this in your RFH2 but I would want somebody else to confirm this |
Confirmed
Use the values in the MCD folder of RFH2. |
|
Back to top |
|
 |
angka |
Posted: Tue Sep 12, 2006 2:21 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
Thanks for the reply. I did try using the MQRFH2.mcd tree before but i got an error. The followings are my code
SET OutputRoot.MQMD.Format ='MQRFH2';
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR';
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 1208;
SET OutputRoot.MQRFH2.mcd.Msd ='MRM';
SET OutputRoot.MQRFH2.mcd.Set ='abkdllljldf';
SET OutputRoot.MQRFH2.mcd.Type ='IncidentReport';
SET OutputRoot.MQRFH2.mcd.Fmt ='CWF1';
i got the "Invalid parser sequence" exception
while running thru the Debug mode i realise tt the MQRFH2.Format field is still blank eventhough i set it in my code.
these are in the compute node. my flow are simple MQInput node follow by Compute node den the MQOutput node.
the exception is caught in the MQOutput node. |
|
Back to top |
|
 |
wschutz |
Posted: Tue Sep 12, 2006 2:28 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
The suggestion was to put a RFH2 header on the message BEFORE the MQInput node gets it ....
Maybe you need to explain exactly what you are trying to accomplish... _________________ -wayne |
|
Back to top |
|
 |
angka |
Posted: Tue Sep 12, 2006 8:28 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
Oh sorry for the vague explanation. Actually my MQ server is supposed to receive messages in text(MQSTR) to Queue A and then the MQInput node will pick up from Queue A and do some computation to determine what Message Type it belongs to. After adding in the MQRFH2 header, the MQOutput node will put the message to Queue B. Then another MQInput node will pick up from queue B and mapped it to XML. However I got the error mentioned in the previous post just before it is put to queue B.. Is there any error in my codes?
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Sep 12, 2006 8:36 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Maybe you should set it to the constant MQFMT_STRING instead of the possibly incorrect literal value 'MQSTR'. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
angka |
Posted: Tue Sep 12, 2006 9:28 pm Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
I try using MQFMT_STRING but the result still the same. I tried alot of ways and the MQRFH2.Format field is still blank after the compute node. while it is in the compute node the value is what I set but once out of it it is blank. any1 come across this before?
Thanks |
|
Back to top |
|
 |
Mercury |
Posted: Wed Sep 13, 2006 12:08 am Post subject: |
|
|
 Apprentice
Joined: 24 Jun 2006 Posts: 32 Location: Hyderabad
|
angka wrote: |
Hi,
Thanks for the reply. I did try using the MQRFH2.mcd tree before but i got an error. The followings are my code
SET OutputRoot.MQMD.Format ='MQRFH2';
|
Hi angka,
Change the above to
SET OutputRoot.MQMD.Format ='MQHRF2 ';
Last edited by Mercury on Wed Oct 11, 2006 8:19 pm; edited 1 time in total |
|
Back to top |
|
 |
supreeth |
Posted: Wed Sep 13, 2006 2:24 am Post subject: |
|
|
 Voyager
Joined: 17 May 2005 Posts: 90 Location: London
|
Hi angka,
The invalid parser sequence is comig probably because you would have tried to set the Output message body to Input message body before setting the MQMD, MQRFH2 headers.
There is a definite position in the message tree for MQMD, MQRFH2 and body. The first in the message tree would be properties, then comes MQMD, any other headers and then the message body. This could be the reason why you may be getting parser exception.
Try out the following piece of code. It would work. I have basically made modifications to your own code.
Code: |
CREATE COMPUTE MODULE TestException_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET OutputRoot.MQMD = InputRoot.MQMD;
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
set OutputRoot.MQRFH2.Version = MQRFH_VERSION_2;
SET OutputRoot.MQRFH2.Format = MQFMT_STRING;
SET OutputRoot.MQRFH2.NameValueCCSID = 1208;
SET OutputRoot.MQRFH2.mcd.Msd ='MRM';
SET OutputRoot.MQRFH2.mcd.Set ='abkdllljldf';
SET OutputRoot.MQRFH2.mcd.Type ='IncidentReport';
SET OutputRoot.MQRFH2.mcd.Fmt ='CWF1';
SET OutputRoot.XML = InputBody;
END;
END MODULE;
|
I am assuming that your input message domain is XML and have given the instruction "SET OutputRoot.XML = InputBody;"
Let me know if it works to you also
Cheerz!!!
Supreeth _________________ Supreeth Gururaj
IBM Certified WMQ Solution Expert |
|
Back to top |
|
 |
angka |
Posted: Wed Sep 13, 2006 7:55 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
Merecury: I did try using MQHRF2 before. think one of them is class the other is method. it dun work.
supreeth: I did call the auto generate procedure CopyMessageHeader and CopyMessageBody before my codes. Ok I will try it and ll let you know.
Thanks all[/list] |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Sep 13, 2006 8:00 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The proper literal value for MQFMT_RF_HEADER_2 is "MQHRF2bb" where "b" is "space". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
angka |
Posted: Wed Sep 13, 2006 8:18 am Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
jefflowrey: Sorry I dun really get what you mean.. you mean i put "MQHRF2 " as the value for OutputRoot.MQMD.Format? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Sep 13, 2006 8:27 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you want the MQMD Format to properly indicate that the message has an MQRFH2 on it, then you need to set the MQMD Format to the correct value.
This can be done using either the literal value "MQHRF2bb" (where "b" is "space") or the constant value MQFMT_RF_HEADER_2.
The way to assign a value to the MQMD Format field in Broker is to SET OutputRoot.Properties.Format or OutputRoot.MQMD.Format. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
supreeth |
Posted: Wed Sep 13, 2006 7:59 pm Post subject: |
|
|
 Voyager
Joined: 17 May 2005 Posts: 90 Location: London
|
Hi,
I don think we would need to hard code the literals when there is a constant available. Correct me if i am wrong.
Code: |
CALL CopyMessageHeaders();
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
set OutputRoot.MQRFH2.Version = MQRFH_VERSION_2;
SET OutputRoot.MQRFH2.Format = MQFMT_STRING;
SET OutputRoot.MQRFH2.NameValueCCSID = 1208;
SET OutputRoot.MQRFH2.mcd.Msd ='MRM';
SET OutputRoot.MQRFH2.mcd.Set ='abkdllljldf';
SET OutputRoot.MQRFH2.mcd.Type ='IncidentReport';
SET OutputRoot.MQRFH2.mcd.Fmt ='CWF1';
SET OutputRoot.XML = InputBody;
|
Please try out the above snippet of code. I am sure it wont throw any exception. I dont see any reason as it not working for you. BTW, what is your input message ???
cheerz!!!
supreeth _________________ Supreeth Gururaj
IBM Certified WMQ Solution Expert |
|
Back to top |
|
 |
|