Author |
Message
|
schroederms |
Posted: Wed Jan 07, 2004 11:57 am Post subject: Help in building WMQI message for Publications for JMS topic |
|
|
 Disciple
Joined: 21 Jul 2003 Posts: 169 Location: IA
|
I have a question on how to do some JMS specific MQRFH2
header fields setting. I've never built a message for
JMS listeners before, so I maybe going down totally
the wrong path here.
Anyway,
I've used the Publication node before to put messages
via topics not JMS topics, and that works fine, but now
I'm wanting to replace a JAVA application
that all it does is read a table every 5 minutes and publish
messages from a specific table. A perfect fit for WMQI flow
with a TIMER fron end, so I've started to build the MQRFH2
header that is currently coming out of the JAVA application
program that uses JMS ( Also, the consumer for this message
also uses JMS and is listening to the topic partners/Publications.)
The output #1 below is from the JMS application
I'm trying to replicate.
The output #2 is from my compute node code.
As you can see, once I get to the "mcd" layer and below it's messed up.
CAN ANYONE GIVE ME SOME HELP ?
Or is there a better way to do this ?
Thanks,
Mike
**** My compute node sql.
DECLARE I INTEGER;
SET I = 1;
WHILE I < CARDINALITY(InputRoot.*[]) DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputRoot.MQMD.Format ='MQHRF2 ';
SET OutputRoot.MQMD.CodedCharSetId=1208;
SET OutputRoot.MQMD.Encoding=546;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format='MQSTR';
SET OutputRoot.MQRFH2.(MQRFH2.Field)Encoding=273;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId=InputRoot.MQMD.CodedCharSetId;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId=1208;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Flags=0;
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID=1208;
SET OutputRoot.MQRFH2.(MQRFH2.Field)mcd.(MQRFH2.Field).Msd='jms_text';
SET OutputRoot.MQRFH2.(MQRFH2.Field)jms.(MQRFH2.Field).Dst='topic://partners/Publications';
SET OutputRoot.MQRFH2.(MQRFH2.Field)jms.(MQRFH2.Field).Dlv=2;
#1. ***** Currently coming from a JMS application .
(0x1000000)MQRFH2 = (
(0x3000000)Version = 2
(0x3000000)Format = 'MQSTR '
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 1208
(0x3000000)Flags = 0
(0x3000000)NameValueCCSID = 1208
(0x1000000)mcd = (
(0x1000000)Msd = (
(0x2000000) = 'jms_text'
)
)
(0x1000000)jms = (
(0x1000000)Dst = (
(0x2000000) = 'topic://partners/Publications'
)
(0x1000000)Tms = (
(0x2000000) = '1073495945013'
)
(0x1000000)Dlv = (
(0x2000000) = '2'
)
)
#2. ***** What I am producing from my compute node.
(0x1000000)MQRFH2 = (
(0x3000000)Format = 'MQSTR'
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 1208
(0x3000000)Flags = 0
(0x3000000)NameValueCCSID = 1208
(0x3000000)mcd = NULL
(
(0x3000000) = NULL
(
(0x1000000)Msd = (
(0x2000000) = 'jms_text'
)
)
(0x1000000)Msd = (
(0x2000000) = 'xml'
)
)
(0x3000000)jms = NULL
(
(0x3000000) = NULL
(
(0x1000000)Dst = (
(0x2000000) = 'topic://partners/Publications'
)
(0x1000000)Dlv = (
(0x2000000) = 2
)
)
)
) |
|
Back to top |
|
 |
EddieA |
Posted: Wed Jan 07, 2004 12:48 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Take out the 'MQRFH2.Field' on everthing that is in the Name/Value pairs:
Code: |
SET OutputRoot.MQRFH2.mcd.Msd='jms_text';
SET OutputRoot.MQRFH2.jms.Dst='topic://partners/Publications';
SET OutputRoot.MQRFH2.jms.Dlv=2;
|
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
schroederms |
Posted: Fri Jan 09, 2004 11:43 am Post subject: |
|
|
 Disciple
Joined: 21 Jul 2003 Posts: 169 Location: IA
|
Thanks EddieA,
Now for whatever reason, my Format under MQRFH2 is not getting set. Do you know why that would be ?
Here is the code:
DECLARE I INTEGER;
SET I = 1;
WHILE I < CARDINALITY(InputRoot.*[]) DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputRoot.MQMD.Format ='MQHRF2 ';
SET OutputRoot.MQMD.CodedCharSetId=1208;
SET OutputRoot.MQMD.Encoding=546;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version=2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format='MQSTR';
SET OutputRoot.MQRFH2.(MQRFH2.Field)Encoding=273;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId=1208;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Flags=0;
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID=1208;
SET OutputRoot.MQRFH2.mcd.Msd='jms_text';
SET OutputRoot.MQRFH2.jms.Dst='topic://partners/Publications';
SET OutputRoot.MQRFH2.jms.Dlv=2;
Here is the results :
(0x1000000)MQRFH2 = (
(0x3000000)Version = 2
(0x3000000)Format = ''
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 1208
(0x3000000)Flags = 0
(0x3000000)NameValueCCSID = 1208
(0x1000000)mcd = (
(0x1000000)Msd = (
(0x2000000) = 'jms_text'
)
)
(0x1000000)jms = (
(0x1000000)Dst = (
(0x2000000) = 'topic://partners/Publications'
)
(0x1000000)Dlv = (
(0x2000000) = 2
)
)
)
Thanks,
Mike |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 09, 2004 11:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
schroederms wrote: |
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format='MQSTR'; |
This is the wrong value for MQFMT_STRING. It should be 'MQSTR ' (with three spaces after it). You can use MQFMT_STRING instead of the actual value.
You may want to do this with 'MQHRF2', as well. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
schroederms |
Posted: Fri Jan 09, 2004 12:08 pm Post subject: |
|
|
 Disciple
Joined: 21 Jul 2003 Posts: 169 Location: IA
|
Thanks Jeff,
But I had that coded with three spaces at one time, but with sthe same results. I tried your suggestion with the same results:
(Since original posting I added a MQRFH build as well)
My code:SET OutputRoot.MQMD.Format ='MQHRF ';
SET OutputRoot.MQMD.CodedCharSetId=1208;
SET OutputRoot.MQMD.Encoding=546;
SET OutputRoot.MQRFH.Version=1;
SET OutputRoot.MQRFH.Encoding=273;
SET OutputRoot.MQRFH.CodedCharSetId=819;
SET OutputRoot.MQRFH.Format='MQHRF2 ';
SET OutputRoot.MQRFH.Flags=0;
SET OutputRoot.MQRFH.UNIQUE_CONNECTION_ID='';
SET OutputRoot.MQRFH.MQPSCommand='Publish';
SET OutputRoot.MQRFH.MQPSTopic='partners/Publications';
SET OutputRoot.MQRFH.MQPSPubOpts='NoReg';
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID=1208;
SET OutputRoot.MQRFH2.mcd.Msd='jms_text';
SET OutputRoot.MQRFH2.jms.Dst='topic://partners/Publications';
SET OutputRoot.MQRFH2.jms.Dlv=2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version=2;
[color=red]SET OutputRoot.MQRFH2.(MQRFH2.Field)Format=MQFMT_STRING;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Encoding=273;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId=1208;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Flags=0;
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID=1208;
SET OutputRoot.MQRFH2.mcd.Msd='jms_text';
SET OutputRoot.MQRFH2.jms.Dst='topic://partners/Publications';
SET OutputRoot.MQRFH2.jms.Dlv=2; [/color]
The results:
(0x1000000)MQRFH = (
(0x3000000)Version = 1
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 819
(0x3000000)Format = 'MQHRF2'
(0x3000000)Flags = 0
(0x3000000)UNIQUE_CONNECTION_ID = ''
(0x3000000)MQPSCommand = 'Publish'
(0x3000000)MQPSTopic = 'partners/Publications'
(0x3000000)MQPSPubOpts = 'NoReg'
)
(0x1000000)MQRFH2 = (
(0x3000000)NameValueCCSID = 1208
(0x1000000)mcd = (
(0x1000000)Msd = (
(0x2000000) = 'jms_text'
)
)
(0x1000000)jms = (
(0x1000000)Dst = (
(0x2000000) = 'topic://partners/Publications'
)
(0x1000000)Dlv = (
(0x2000000) = 2
)
)
(0x3000000)Version = 2
([color=red]0x3000000)Format = ''
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 1208
(0x3000000)Flags = 0
)[/color] |
|
Back to top |
|
 |
EddieA |
Posted: Fri Jan 09, 2004 1:31 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
I think that's because you don't actually have any payload. I've seen a reference to this somewhere, but I can't remember where, that WMQI has some 'intelligence' when it comes to setting the Formats. As you haven't actually got any data, then the contents of Format don't matter.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
schroederms |
Posted: Tue Jan 13, 2004 7:00 am Post subject: |
|
|
 Disciple
Joined: 21 Jul 2003 Posts: 169 Location: IA
|
That was it Eddie, Thanks for everyones help. Mike  |
|
Back to top |
|
 |
|