ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Publishing by Adding MQRFH2 Header-Problem

Post new topic  Reply to topic
 Publishing by Adding MQRFH2 Header-Problem « View previous topic :: View next topic » 
Author Message
shilpadesai
PostPosted: Mon Jul 15, 2002 12:06 pm    Post subject: Publishing by Adding MQRFH2 Header-Problem Reply with quote

Novice

Joined: 09 May 2002
Posts: 12

Friends,

I am trying to publish mq text messages dropped by an applicaiton. Its the responsibility of the FLOW to add MQRFH2 header to these messages and then publish it.

My Flow is simple: MQInput --> Compute --> Publish
Compute Node is where I add MQRFH2 header using following ESQL.

SET OutputRoot = InputRoot;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputRoot.MQMD.Format ='MQHRF';
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)NameValueCCSID = 1208;
SET OutputRoot.MQRFH2.psc.Command = 'Publish';
SET OutputRoot.MQRFH2.psc.Topic = 'MyNotification';
SET OutputRoot.MQRFH2.psc.QMgrName = 'my.queue.manager';
SET OutputRoot.MQRFH2.psc.QName = 'SYSTEM.BROKER.DEFAULT.STREAM';
SET OutputRoot.MQRFH2.psc.RegOpt = 'NoReg';
SET OutputRoot.MQRFH2.mcd.Msd = 'jms_text';
SET OutputRoot.MQRFH2.mcd.Type = 'jms_text';

SET OutputRoot.MQRFH2.jms.Dst='topic://MyNotification' ;
SET OutputRoot.MQRFH2.jms.Dlv=1 ;

SET OutputRoot.MQRFH2.usr.topic='UpdateMsg';

--SET "OutputRoot"."BLOB"."BLOB" = ' Some Info' ;

Problem:

In above code as you see when I comment last line I am able to receive the publication for messages published through this FLOW. But when I uncomment I am not receiveing any publications !!. The Subscriber in this case is a JMS Application.

Any thoughts, why adding data to message prevents it from reaching to a JMS subscriber ?

Shilpa Desai
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Mon Jul 15, 2002 12:40 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

This means there is a problem with line,
--SET "OutputRoot"."BLOB"."BLOB" = ' Some Info' ;

The correct format of creating body message is,
SET "OutputRoot"."BLOB"."BLOB" = X'4d4c4d....'; (Hexadecimal string on RHS).

Do you want to modify input message in this compute node? I guess not! So, you should remove the line (SET OutputRoot.BLOB.BLOB...) from your code.

If you want to create new message body or update incoming message, you should say "Copy Message Headers Only" in your compute node and then create new body using above ESQL.

Hope this helps.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
shilpadesai
PostPosted: Mon Jul 15, 2002 1:31 pm    Post subject: Reply with quote

Novice

Joined: 09 May 2002
Posts: 12

Thanks Kiran,

I do want to save the Body and I looked into your Hexadecimal advice and changed the line to

SET "OutputRoot"."BLOB"."BLOB" = "InputRoot"."BLOB"."BLOB" ;

and now my JMS Subscriber is able to receive the published message. But now it creates different problem:

I am NOT getting MQRFH2 Header I am adding in ESQL code !! . Now I am using 'Copy Message Headers Only'

What is going on ?

I am adding the Trace I took just before publish Node:
(
(0x1000000)Properties = (
(0x3000000)MessageSet = ''
(0x3000000)MessageType = 'jms_text'
(0x3000000)MessageFormat = 'MQHRF2'
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 819
(0x3000000)Transactional = FALSE
(0x3000000)Persistence = FALSE
(0x3000000)CreationTime = GMTTIMESTAMP '2002-07-15 21:50:15.190'
(0x3000000)ExpirationTime = -1
(0x3000000)CreationTime = GMTTIMESTAMP '2002-07-15 21:50:15.190'
(0x3000000)ExpirationTime = -1
(0x3000000)Priority = 0
(0x3000000)ReplyIdentifier = X'000000000000000000000000000000000000000000000
000'
(0x3000000)ReplyProtocol = 'MQ'
(0x3000000)Topic = 'MagicNotification'
)
(0x1000000)MQMD = (
(0x3000000)SourceQueue = 'MAGICAPP.LQ.ALERT'
(0x3000000)Transactional = FALSE
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 819
(0x3000000)Format = 'MQHRF2'
(0x3000000)Version = 2
(0x3000000)Report = 0
(0x3000000)MsgType = 8
(0x3000000)Expiry = -1
(0x3000000)Feedback = 0
(0x3000000)Priority = 0
(0x3000000)Persistence = 0
(0x3000000)MsgId = X'414d51206d616769632e71756575652e3d1a23690039
f013'
(0x3000000)Persistence = 0
(0x3000000)MsgId = X'414d51206d616769632e71756575652e3d1a23690039
f013'
(0x3000000)CorrelId = X'00000000000000000000000000000000000000000000
0000'
(0x3000000)BackoutCount = 0
(0x3000000)ReplyToQ = '
'
(0x3000000)ReplyToQMgr = 'my.queue.manager
'
(0x3000000)UserIdentifier = 'mqm '
(0x3000000)AccountingToken = X'05333030323400000000000000000000000000000000
00000000000000000006'
(0x3000000)ApplIdentityData = ' '
(0x3000000)PutApplType = 6
(0x3000000)PutApplName = ' '
(0x3000000)PutDate = DATE '2002-07-15'
(0x3000000)PutTime = GMTTIME '21:50:15.190'
(0x3000000)ApplOriginData = ' '
(0x3000000)GroupId = X'00000000000000000000000000000000000000000000
0000'
(0x3000000)MsgSeqNumber = 1
(0x3000000)Offset = 0
(0x3000000)MsgSeqNumber = 1
(0x3000000)Offset = 0
(0x3000000)MsgFlags = 0
(0x3000000)OriginalLength = -1
)
(0x1000000)MQRFH2 = (
(0x3000000)Version = 2
(0x3000000)Format = 'MQSTR'
(0x3000000)Encoding = 273
(0x3000000)NameValueCCSID = 1208
(0x1000000)psc = (
(0x1000000)Command = (
(0x2000000) = 'Publish'
)
(0x1000000)Topic = (
(0x2000000) = 'MyNotification'
)
(0x1000000)QMgrName = (
(0x2000000) = 'magic.queue.manager'
)
(0x1000000)QName = (
(0x2000000) = 'SYSTEM.BROKER.DEFAULT.STREAM'
)
(0x2000000) = 'SYSTEM.BROKER.DEFAULT.STREAM'
)
(0x1000000)RegOpt = (
(0x2000000) = 'NoReg'
)
)
(0x1000000)mcd = (
(0x1000000)Msd = (
(0x2000000) = 'none'
)
(0x1000000)Type = (
(0x2000000) = 'jms_text'
)
)
(0x1000000)jms = (
(0x1000000)Dst = (
(0x2000000) = 'topic://MyNotification'
)
(0x1000000)Dlv = (
(0x2000000) = 1
)
)
(0x1000000)usr = (
)
(0x1000000)usr = (
(0x1000000)topic = (
(0x2000000) = 'UpdateMsg'
)
)
)
(0x1000000)BLOB = (
(0x3000000)BLOB = X'4d617373557064617465'
)

Thanks,

Shilpa Desai

IBM Certified Specialist
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Mon Jul 15, 2002 2:21 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Hi Shilpa,

Since you are publishing input message as it is, I would suggest you to modify your compute node to say "Copy Entire Message" and remove the message body construction from your code. Please remove line,
SET OutputRoot."BLOB"."BLOB" = InputRoot."BLOB"."BLOB";

There is a very small typo error in your code, please correct it and it work!
Code:

SET OutputRoot.MQMD.Format = [b]'MQRFH'[/b];

_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
shilpadesai
PostPosted: Tue Jul 16, 2002 6:08 am    Post subject: Reply with quote

Novice

Joined: 09 May 2002
Posts: 12

Kiran,

What kind of Typo you are refering. The format I am using is
MQFMT_RF_HEADER_2 defined as 'MQHRF2'.

I am still struggling with this problem.

Shilpa Desai
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Tue Jul 16, 2002 7:29 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Shilpa,

In your first post, you have mistyped the line. It should be,
SET OutputRoot.MQMD.Format = 'MQRFH2';
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
shilpadesai
PostPosted: Tue Jul 16, 2002 7:44 am    Post subject: Reply with quote

Novice

Joined: 09 May 2002
Posts: 12

Kiran, I do not see MQRFH2 as format. API Book has defined MQFMT_RF_HEADER_2 as 'MQHRF2' So the line should look like

SET OutputRoot.MQMD.Format = 'MQHRF2';

NOT

SET OutputRoot.MQMD.Format = 'MQRFH2';

Still I am going to try with your suggestion.

Shilpa desai
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Tue Jul 16, 2002 9:41 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Shilpa,

You are correct. I just verified the Format name in API book and it is 'MQHRF2bb', where b is blank space.

Your code should work with these lines,

SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format= MQFMT_STRING ;
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
shilpadesai
PostPosted: Tue Jul 16, 2002 11:10 am    Post subject: Reply with quote

Novice

Joined: 09 May 2002
Posts: 12

I traced JMS code and this is my observation:

I am setting OutputRoot.MQRFH2.mcd.Msd = 'jms_text' ;

and the JMS Scbscriber received the publication with <Mcd> value as none !!!! <mcd><Msd>none</Msd></mcd>. In this scenario I am doing
SET OutputRoot."BLOB"."BLOB" = InputRoot."BLOB"."BLOB";
and 'Copy Headers only'. I can see MQRFH2 Format as MQSTR

When I do 'Copy Message' and I removed
SET OutputRoot."BLOB"."BLOB" = InputRoot."BLOB"."BLOB";

and I am getting <Mcd> value as jms_text <mcd><Msd>jms_text</Msd></mcd>, but I do not see any body text. Where is my Body Text disappering ? Also in this case the Format of MQRFH2 is blank. Here I see MQRFH2 Format as blank (all spaces).

In earlier case JMS is throwing JMS MessageFormatException and in later case NullPointerException as body is empty.

does this gives any clue ??

Shilpa Desai
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Tue Jul 16, 2002 2:54 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Shilpa,

What is your input message format? Is it XML or BLOB?

If you reset your message domain to anything other than XML, you will have this problem.

I created a small message flow to test this. My message flow is like this,
MQInput(XML)->Compute1->Trace1->MQOutput

Compute node is configured to copy Message headers only.
Compute Node ESQL:
Code:

SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format= MQFMT_STRING ;
SET OutputRoot.MQRFH2.(MQRFH2.Field)"Encoding" = 273;
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 1208;
SET OutputRoot.MQRFH2.psc.Command = 'Publish';
SET OutputRoot.MQRFH2.psc.Topic = 'MyNotification';
SET OutputRoot.MQRFH2.psc.QMgrName = 'my.queue.manager';
SET OutputRoot.MQRFH2.psc.QName = 'SYSTEM.BROKER.DEFAULT.STREAM';
SET OutputRoot.MQRFH2.psc.RegOpt = 'NoReg';
SET OutputRoot.MQRFH2.mcd.Msd = 'jms_text';
SET OutputRoot.MQRFH2.mcd.Type = 'jms_text';
SET OutputRoot.MQRFH2.jms.Dst='topic://MyNotification' ;
SET OutputRoot.MQRFH2.jms.Dlv=1 ;
SET OutputRoot.MQRFH2.usr.topic='UpdateMsg';
SET OutputRoot.XML = InputRoot.XML;


Input Message:
<A>Testing Publication</A>

Trace Output:
Code:

(
  (0x1000000)Properties = (
    (0x3000000)MessageSet      = ''
    (0x3000000)MessageType     = 'jms_text'
    (0x3000000)MessageFormat   = ''
    (0x3000000)Encoding        = 273
    (0x3000000)CodedCharSetId  = 437
    (0x3000000)Transactional   = TRUE
    (0x3000000)Persistence     = FALSE
    (0x3000000)CreationTime    = GMTTIMESTAMP '2002-07-16 22:29:49.730'
    (0x3000000)ExpirationTime  = -1
    (0x3000000)Priority        = 0
    (0x3000000)ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
    (0x3000000)ReplyProtocol   = 'MQ'
    (0x3000000)Topic           = 'MyNotification'
  )
  (0x1000000)MQMD       = (
    (0x3000000)SourceQueue      = 'KI.IN'
    (0x3000000)Transactional    = TRUE
    (0x3000000)Encoding         = 546
    (0x3000000)CodedCharSetId   = 437
    (0x3000000)Format           = 'MQHRF2  '
    (0x3000000)Version          = 2
    (0x3000000)Report           = 0
    (0x3000000)MsgType          = 8
    (0x3000000)Expiry           = -1
    (0x3000000)Feedback         = 0
    (0x3000000)Priority         = 0
    (0x3000000)Persistence      = 0
    (0x3000000)MsgId            = X'414d51204148315f544e4c31312020207940343da2f10600'
    (0x3000000)CorrelId         = X'000000000000000000000000000000000000000000000000'
    (0x3000000)BackoutCount     = 0
    (0x3000000)ReplyToQ         = '                                                '
    (0x3000000)ReplyToQMgr      = 'AH1_TNL11                                       '
    (0x3000000)UserIdentifier   = 'CI64        '
    (0x3000000)AccountingToken  = X'160105150000007b104b789619207c71455400c158000000000000000000000b'
    (0x3000000)ApplIdentityData = '                                '
    (0x3000000)PutApplType      = 11
    (0x3000000)PutApplName      = 'C:\WINNT\system32\mmc.exe'
    (0x3000000)PutDate          = DATE '2002-07-16'
    (0x3000000)PutTime          = GMTTIME '22:29:49.730'
    (0x3000000)ApplOriginData   = '    '
    (0x3000000)GroupId          = X'000000000000000000000000000000000000000000000000'
    (0x3000000)MsgSeqNumber     = 1
    (0x3000000)Offset           = 0
    (0x3000000)MsgFlags         = 0
    (0x3000000)OriginalLength   = -1
  )
  (0x1000000)MQRFH2     = (
    (0x3000000)Version        = 2
    (0x3000000)Format         = 'MQSTR   '
    (0x3000000)Encoding       = 273
    (0x3000000)NameValueCCSID = 1208
    (0x1000000)psc            = (
      (0x1000000)Command  = (
        (0x2000000) = 'Publish'
      )
      (0x1000000)Topic    = (
        (0x2000000) = 'MyNotification'
      )
      (0x1000000)QMgrName = (
        (0x2000000) = 'my.queue.manager'
      )
      (0x1000000)QName    = (
        (0x2000000) = 'SYSTEM.BROKER.DEFAULT.STREAM'
      )
      (0x1000000)RegOpt   = (
        (0x2000000) = 'NoReg'
      )
    )
    (0x1000000)mcd            = (
      (0x1000000)Msd  = (
        (0x2000000) = 'xml'
      )
      (0x1000000)Type = (
        (0x2000000) = 'jms_text'
      )
    )
    (0x1000000)jms            = (
      (0x1000000)Dst = (
        (0x2000000) = 'topic://MyNotification'
      )
      (0x1000000)Dlv = (
        (0x2000000) = 1
      )
    )
    (0x1000000)usr            = (
      (0x1000000)topic = (
        (0x2000000) = 'UpdateMsg'
      )
    )
  )
  (0x1000010)XML        = (
    (0x1000000)A = (
      (0x2000000) = 'Testing Publication'
    )
  )
)


As you can see here, the original Input message is retained and <mcd><Msd>xml</Msd><Type>jms_text</Type></mcd> is set correctly.

You could modify your message flow to reflect these changes and see if that solves your problem.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
granthmuk
PostPosted: Wed Jul 17, 2002 1:31 am    Post subject: Reply with quote

Apprentice

Joined: 16 May 2001
Posts: 38
Location: Edinburgh, Scotland

If your data is plain text then you may need to add a reset content descriptor node just before your Publish node to force WMQI to use jms_text as the message domain. I do this in some flows I use to talk to IMS through WMQI from a JMS client.

In the RCD type jms_text in the Message Domain entry field and select the Reset Message Domain checkbox.
Back to top
View user's profile Send private message
shilpadesai
PostPosted: Mon Jul 22, 2002 6:30 am    Post subject: Reply with quote

Novice

Joined: 09 May 2002
Posts: 12

Thanks Kiran for your help, my message format was BLOB and I changed it to XML and I got the output message as shown by you.

But the JMS does not like <Mcd>xml<Mcd>. So granthmuk suggestion was helpful in this matter.

Once agian thanks to Kiran and granthmuk

Shilpa Desai
Back to top
View user's profile Send private message Send e-mail
6FA
PostPosted: Thu Aug 04, 2016 3:24 am    Post subject: Re: Publishing by Adding MQRFH2 Header-Problem Reply with quote

Novice

Joined: 08 Jan 2016
Posts: 21

Try by commenting Encoding, NameValueCCSID lines

Thanks
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Aug 04, 2016 3:34 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

6FA,
Do you really think that the Original Poster has been sitting arounf for 14 , yes Fourteen years waiting for your words of wisdom?
Please don't re-open old threads like this.

Please DO start a new thread and reference the original.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Publishing by Adding MQRFH2 Header-Problem
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.