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 » variable length msg on input Q

Post new topic  Reply to topic
 variable length msg on input Q « View previous topic :: View next topic » 
Author Message
ryzor
PostPosted: Tue Sep 07, 2004 10:36 pm    Post subject: variable length msg on input Q Reply with quote

Apprentice

Joined: 31 Dec 2001
Posts: 42

Hi Guys,

I have an incoming message which comes in variable length from a legacy system. I want to accept the message and cut the fiirst 38 characters and then reparse the rest of the remaining characters.

I'm not sure which domain to use to accept this message so that i can be able to manipulate it in the compute node.

please assist - ryzor.
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Tue Sep 07, 2004 10:39 pm    Post subject: Reply with quote

Jedi Knight

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

You can either define your message in CWF or TDS wire format. Can you provide more details about the message layout?
_________________
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
ryzor
PostPosted: Wed Sep 08, 2004 1:48 am    Post subject: Reply with quote

Apprentice

Joined: 31 Dec 2001
Posts: 42

The lenght of my messages are devided into 3

Header Rec - Data Lenght = 495, Format = MQHRF, character set = 819
Detail Rec - Data Lenght = 651, Format = MQHRF, character set = 819
Trailer Rec - Data Length = 456, Format = MQHRF, character set = 819

when i browse the messages on the Q, they are all prefixed by the MQRFH data, do i have to take this information into account when i get the message from the Q by the MQInput node?
Back to top
View user's profile Send private message Send e-mail
kirani
PostPosted: Wed Sep 08, 2004 10:31 pm    Post subject: Reply with quote

Jedi Knight

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

Is there any application related info in MQRFH data that you will need during the processing of the message? If so, then you will need this info.
Again, can you post sample message layout/format? In general, yes, you can model this using TDS or CWF. But once you post your sample message one can suggest one foramt.
I'm sure there is an indicator in your message which explains what type of message you are processing?
Basically, you can define 3 different messages in MRM to parse these messages.
_________________
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
ryzor
PostPosted: Thu Sep 09, 2004 12:47 am    Post subject: Reply with quote

Apprentice

Joined: 31 Dec 2001
Posts: 42

Thanx Kirani,

basically whats happening is that i'm trying to parse messages which were initially intended for mqsi v1.1 [ passed to mqsi by a C program which appends an MQRFH header to each message ] ...

so i manually removed the header from the messages to see if i could parse them - thats when the variable length problem came in. I wanted to remove the first 38 characters of the message " <?xml version="1.0" encoding="UTF-8"?> " --- every message which is created the this C program have this characters appended to them, just after the characters the message is pure XML,

so i'm now able to remove this characters as WMQI v2 rejects them when i try to parse them as XML ... i used this code:

DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C 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.

--DECLARE X INTEGER;
--SET X = CARDINALITY(InputRoot.BLOB.*[]);
--DECLARE P INTEGER;
--SET P = 1;
--WHILE P < C DO
-- SET OutputRoot.BLOB.*[P] = InputRoot.BLOB.*[P];
-- SET P=P+1;
--END WHILE;

SET OutputRoot.BLOB.BLOB = substring(InputRoot.BLOB.BLOB from 39);


generally all my messages looks like this:

RFH .......H........MQSTR ..coOPT_APP_GRP PLI OPT_MSG_TYPE TAT.In.PLI <?xml version="1.0" encoding="UTF-8"?><PLIMsg><Head><File><Name>PLK1P181.746.RecToMs
g.complete</Name><Date>20040907</Date><Time>10:58:29</Time></File><RulesKey><Task>RecToMsg</Task><Source><Name>TAT</Name><Version></Version></Source><BU></B
U></RulesKey><Group><Type>2HDR</Type><Fields></Fields></Group></Head><Body><DataSet><Data><Stream>2HDR27088471PLK1 6720040826141707</Stream></Data></DataSet></Body></PLIMsg>


I'm looking for a machenism which would help me interpret this message in WMQI v2... my approach was to trancate both the MQRFH header and the first 38 characters " <?xml version="1.0" encoding="UTF-8"?> "


Thanx for you continued help.
Back to top
View user's profile Send private message Send e-mail
shanson
PostPosted: Thu Sep 09, 2004 3:25 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

Your message is MQMD followed by MQRFH followed by XML? And you don't want to parse the message body using the New Era parsers? I have a suggestion but I don't know if it will work.

Specifying XML domain on the input node won't work, because the MQRFH parser only reacts to NEONMSG and NEON domains. But you might be able to stick a ResetContentDescriptor node after the MQInput node and force the body to be parsed as XML that way. Let us know what happens.
Back to top
View user's profile Send private message
ryzor
PostPosted: Thu Sep 09, 2004 6:35 am    Post subject: Reply with quote

Apprentice

Joined: 31 Dec 2001
Posts: 42

I tried to accept the message and reparse it - i got the following error on my trace file - previously when the msg was getting through it was because i manually trancated the MQRFH header to deal with the variable lenght issue.

(0x1000000)MQMD = (
(0x3000000)SourceQueue = 'TrackAndTraceSpeedIn'
(0x3000000)Transactional = TRUE
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 819
(0x3000000)Format = 'MQHRF '
(0x3000000)Version = 2
(0x3000000)Report = 0
(0x3000000)MsgType = 8
(0x3000000)Expiry = -1
(0x3000000)Feedback = 0
(0x3000000)Priority = 0
(0x3000000)Persistence = 1
(0x3000000)MsgId = X'2a2a5341504f5f46495253545f494e5f42415443482a2a20'
(0x3000000)CorrelId = X'414d5120504f4d51493130312e5a412e3f1bc2b10479a013'
(0x3000000)BackoutCount = 401
(0x3000000)ReplyToQ = ' '
(0x3000000)ReplyToQMgr = 'POMQI101.ZA.QMGR '
(0x3000000)UserIdentifier = 'mqappl '
(0x3000000)AccountingToken = X'0332343600000000000000000000000000000000000000000000000000000006'
(0x3000000)ApplIdentityData = ' '
(0x3000000)PutApplType = 6
(0x3000000)PutApplName = ' '
(0x3000000)PutDate = DATE '2004-09-09'
(0x3000000)PutTime = GMTTIME '13:28:33.990'
(0x3000000)ApplOriginData = ' '
(0x3000000)GroupId = X'000000000000000000000000000000000000000000000000'
(0x3000000)MsgSeqNumber = 1
(0x3000000)Offset = 0
(0x3000000)MsgFlags = 0
(0x3000000)OriginalLength = -1
)
(0x1000000)MQRFH = (
(0x3000000)Version = 1
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 0
(0x3000000)Format = 'MQSTR '
(0x3000000)Flags = 6386792
(0x3000000)OPT_APP_GRP = 'PLI'
(0x3000000)OPT_MSG_TYPE = 'TAT.In.PLI'
)
(0x1000000)NEON = (
(0x1000000)Properties = (
(0x3000000)MessageSet = 'PLI'
(0x3000000)MessageType = 'TAT.In.PLI'
(0x3000000)MessageFormat = ''
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 0
(0x3000000)Transactional = TRUE
(0x3000000)Persistence = TRUE
(0x3000000)CreationTime = GMTTIMESTAMP '2004-09-09 13:28:33.990'
(0x3000000)ExpirationTime = -1
(0x3000000)Priority = 0
(0x3000000)ReplyIdentifier = X'414d5120504f4d51493130312e5a412e3f1bc2b10479a013'
(0x3000000)ReplyProtocol = 'MQ'
(0x3000000)Topic = NULL

My next step is to take Shansons' advice of creating NEON domain in version 2 and c what happens - i will keep you posted.

Thanx for the help, -ryzor.
Back to top
View user's profile Send private message Send e-mail
shanson
PostPosted: Thu Sep 09, 2004 7:07 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

You have not posted the error?
Back to top
View user's profile Send private message
ryzor
PostPosted: Sun Sep 12, 2004 2:33 am    Post subject: Reply with quote

Apprentice

Joined: 31 Dec 2001
Posts: 42

All that i pasted was what i got from the trace file.

I have taken the approach of using the NEON domain as my parser ... the messages are now getting through - but now when i try to use the reset content descripter to XML - i get the following error message on my trace node:

(
(0x1000000)Properties = (
(0x3000000)MessageSet = 'PLI'
(0x3000000)MessageType = 'TAT.In.PLI'
(0x3000000)MessageFormat = ''
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 0
(0x3000000)Transactional = TRUE
(0x3000000)Persistence = TRUE
(0x3000000)CreationTime = GMTTIMESTAMP '2004-09-12 10:19:28.190'
(0x3000000)ExpirationTime = -1
(0x3000000)Priority = 0
(0x3000000)ReplyIdentifier = X'414d5120504f4d51493130312e5a412e3f1bc2b104896013'
(0x3000000)ReplyProtocol = 'MQ'
(0x3000000)Topic = NULL
)
(0x1000000)MQMD = (
(0x3000000)SourceQueue = 'TrackAndTraceSpeedIn'
(0x3000000)Transactional = TRUE
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 819
(0x3000000)Format = 'MQHRF '
(0x3000000)Version = 2
(0x3000000)Report = 0
(0x3000000)MsgType = 8
(0x3000000)Expiry = -1
(0x3000000)Feedback = 0
(0x3000000)Priority = 0
(0x3000000)Persistence = 1
(0x3000000)MsgId = X'2a2a5341504f5f46495253545f494e5f42415443482a2a20'
(0x3000000)CorrelId = X'414d5120504f4d51493130312e5a412e3f1bc2b104896013'
(0x3000000)BackoutCount = 0
(0x3000000)ReplyToQ = ' '
(0x3000000)ReplyToQMgr = 'POMQI101.ZA.QMGR '
(0x3000000)UserIdentifier = 'mqappl '
(0x3000000)AccountingToken = X'0332343600000000000000000000000000000000000000000000000000000006'
(0x3000000)ApplIdentityData = ' '
(0x3000000)PutApplType = 6
(0x3000000)PutApplName = ' '
(0x3000000)PutDate = DATE '2004-09-12'
(0x3000000)PutTime = GMTTIME '10:19:28.190'
(0x3000000)ApplOriginData = ' '
(0x3000000)GroupId = X'000000000000000000000000000000000000000000000000'
(0x3000000)MsgSeqNumber = 1
(0x3000000)Offset = 0
(0x3000000)MsgFlags = 0
(0x3000000)OriginalLength = -1
)
(0x1000000)MQRFH = (
(0x3000000)Version = 1
(0x3000000)Encoding = 273
(0x3000000)CodedCharSetId = 0
(0x3000000)Format = 'MQSTR '
(0x3000000)Flags = 3040111
(0x3000000)OPT_APP_GRP = 'PLI'
(0x3000000)OPT_MSG_TYPE = 'TAT.In.PLI'
)
(0x1000010)XML = (
(0x5000018)XML = (
(0x6000011) = '1.0'
(0x6000012) = 'UTF-8'
)
(0x1000000)PLIMsg = (
(0x1000000)Head = (
(0x1000000)File = (
(0x1000000)Name = (
(0x2000000) = 'PLK1P181.746.RecToMsg.complete'
)
(0x1000000)Date = (
(0x2000000) = '20040912'
)
(0x1000000)Time = (
(0x2000000) = '12:19:23'
)
)
(0x1000000)RulesKey = (
(0x1000000)Task = (
(0x2000000) = 'RecToMsg'
)
(0x1000000)Source = (
(0x1000000)Name = (
(0x2000000) = 'TAT'
)
(0x1000000)Version =
)
(0x1000000)BU =
)
(0x1000000)Group = (
(0x1000000)Type = (
(0x2000000) = '2HDR'
)
(0x1000000)Fields =
)
)
(0x1000000)Body = (
(0x1000000)DataSet = (
(0x1000000)Data = (
(0x1000000)Stream = (
(0x2000000) = '2HDR27088471PLK1 6720040826141707'
)
)
)
)
)
)
)
__________________________
(
(0x1000000)RecoverableException = (
(0x3000000)File = 'F:\build\S210_P\src\DataFlowEngine\ImbDataFlowNode.cpp'
(0x3000000)Line = 536
(0x3000000)Function = 'ImbDataFlowNode::createExceptionList'
(0x3000000)Type = 'ComIbmMQOutputNode'
(0x3000000)Name = 'ee3c5cd8-fe00-0000-0080-e383df5cda7c'
(0x3000000)Label = 'TrackAndTraceSpeed.PLI.SPEED.MSGTOMSG.DETAIL'
(0x3000000)Text = 'Node throwing exception'
(0x3000000)Catalog = 'WMQIv210'
(0x3000000)Severity = 3
(0x3000000)Number = 2230
(0x1000000)RecoverableException = (
(0x3000000)File = 'F:\build\S210_P\src\DataFlowEngine\ImbMqOutputNode.cpp'
(0x3000000)Line = 1914
(0x3000000)Function = 'ImbMqOutputNode::putMessage'
(0x3000000)Type = 'ComIbmMQOutputNode'
(0x3000000)Name = 'ee3c5cd8-fe00-0000-0080-e383df5cda7c'
(0x3000000)Label = 'TrackAndTraceSpeed.PLI.SPEED.MSGTOMSG.DETAIL'
(0x3000000)Text = 'Unable to put message'
(0x3000000)Catalog = 'WMQIv210'
(0x3000000)Severity = 3
(0x3000000)Number = 2620
(0x1000000)Insert = (
(0x3000000)Type = 5
(0x3000000)Text = 'DevBroker'
)
(0x1000000)Insert = (
(0x3000000)Type = 5
(0x3000000)Text = 'TrackAndTraceSpeedOut'
)
(0x1000000)Insert = (
(0x3000000)Type = 2
(0x3000000)Text = '2'
)
(0x1000000)Insert = (
(0x3000000)Type = 2
(0x3000000)Text = '2334'
)
)
)
)


but when i bypass the content descripter to put messages straight to the output q they fail saying that the RFH header is wrong.

i tried to solve this by using a compute node so that i could change the OutputRoot.MQMD.Format = 'MQSTR'; - then empty messages are put on the output Q - with the "put/date and time" saying the message have INVALID put date/time.

i'm really running out of options

please help.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » variable length msg on input Q
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.