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 » IBM MQ Java / JMS » MQ JMS error while reading a message off the queue

Post new topic  Reply to topic
 MQ JMS error while reading a message off the queue « View previous topic :: View next topic » 
Author Message
chris boehnke
PostPosted: Tue Jul 17, 2007 5:07 am    Post subject: MQ JMS error while reading a message off the queue Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

I am getting this error message when trying to get the message off the queue:..I am reading the messages through JMS.

MQJMS1050: The MQRFH2 header has an incorrect format

I wasn't getting this message when message broker was not involved.

Any suggestions please???

Thanks.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jul 17, 2007 5:12 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Don't double post; pick a likely looking section and plump. The moderators can always move it later!

http://www.mqseries.net/phpBB2/viewtopic.php?t=38319&highlight=

So it works until the broker is involved? How is broker generating the RFH2?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
chris boehnke
PostPosted: Tue Jul 17, 2007 5:34 am    Post subject: Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

Vitor wrote:
Don't double post; pick a likely looking section and plump. The moderators can always move it later!

http://www.mqseries.net/phpBB2/viewtopic.php?t=38319&highlight=

So it works until the broker is involved? How is broker generating the RFH2?


Hi Vitor,
Here I am using a Compute node to generate the RFH2 header

CREATE COMPUTE MODULE FlowABC_AddJMSHeaders
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
CALL CopyEntireMessage();

-- If there is no RFH2 header, add one
IF CARDINALITY(OutputRoot.MQRFH2.*[]) = 0 THEN
CREATE NEXTSIBLING OF OutputRoot.MQMD DOMAIN 'MQRFH2';
END IF;

-- Set MQRFH2 struct fields
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR ';

-- Set the JMS destination and reply fields
SET OutputRoot.MQRFH2.jms.Dst = 'queue:///ESB.REQUEST';
SET OutputRoot.MQRFH2.jms.Rto = 'queue:///ESB.REPLY';
SET OutputRoot.MQRFH2.mcd.Msd = 'jms_text';

-- Set MQRFH2 User attributes
SET OutputRoot.MQRFH2.usr = NULL;
RETURN TRUE;
END;

Please let me know whether I am missing something or need to eliminate anything???.

Thanks.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jul 17, 2007 5:55 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

I think your problem is that you're creating a NEXTSIBLING of MQMD. The first sibling of MQMD is the message body, the RFH2 will be the next and hence it's in the wrong place.

A Trace node will tell the tale.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 17, 2007 6:17 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Um...

I believe that NEXTSIBLING is the correct place for MQRFH2 tree.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/topic/com.ibm.etools.mft.doc/ac12610_.htm

Either the MQMD.Format field is not set to MQFMT_RF_HEADER_2 or the MQRFH2.Format is not properly set to MQFMT_STRING - I see the constant 'MQSTR ', but it's always better to use the constant.

Also, I'm not sure that MQRFH2.Format is an MQRFH2.Field.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jul 17, 2007 6:46 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

jefflowrey wrote:
Um...

I believe that NEXTSIBLING is the correct place for MQRFH2 tree.



Granted, but if you've already done a CopyEntireMessage doesn't MQMD already have a sibling called Body? Or am I being thicker than a whale sandwich?

(It's the day for it! )
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 17, 2007 6:48 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Vitor wrote:
Or am I being thicker than a whale sandwich?


I'll not make any cracks about your weight, as I've no basis to judge...

CREATE .. NEXTSIBLING will insert the MQRFH2 as the next sibling. So, afaik, that line of code is actually correct.

But only a Trace knows for sure.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
chris boehnke
PostPosted: Tue Jul 17, 2007 8:01 am    Post subject: Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

jefflowrey wrote:
Vitor wrote:
Or am I being thicker than a whale sandwich?


I'll not make any cracks about your weight, as I've no basis to judge...

CREATE .. NEXTSIBLING will insert the MQRFH2 as the next sibling. So, afaik, that line of code is actually correct.

But only a Trace knows for sure.


Hi Guys,
Here is the message flows scenario:

FanOut flow: Input queue -> Aggregate Control -> Compute(XSLT transformation) -> Compute node(Add Jms Header, the code what I mentioned above) -> Aggregate request

FanIn flow: Original Msg + Reply from Destination App => Aggregate reply -> Compute (transformation using XSLT) -> MQoutput node(output queue)

The problem is not in the request message flow(FanOut).

The problem is in the reply message after translation and getting off the message from output queue.

Suggestions please
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 17, 2007 8:06 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

jefflowrey wrote:
Either the MQMD.Format field is not set to MQFMT_RF_HEADER_2 or the MQRFH2.Format is not properly set to MQFMT_STRING - I see the constant 'MQSTR ', but it's always better to use the constant.

Also, I'm not sure that MQRFH2.Format is an MQRFH2.Field.

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
chris boehnke
PostPosted: Tue Jul 17, 2007 10:57 am    Post subject: Reply with quote

Partisan

Joined: 25 Jul 2006
Posts: 369

jefflowrey wrote:
jefflowrey wrote:
Either the MQMD.Format field is not set to MQFMT_RF_HEADER_2 or the MQRFH2.Format is not properly set to MQFMT_STRING - I see the constant 'MQSTR ', but it's always better to use the constant.

Also, I'm not sure that MQRFH2.Format is an MQRFH2.Field.


I see the MQMD.Format = MQRFH2 and MQRFH2.Format = 'MQSTR '.

Here is the message tree structure:

Message
Properties
MQMD
SourceQueue = ESB.REQUEST
Transactional = true
Encoding = 546
CodedCharSetId = 437
Format = MQHRF2
Version = 2
Report = 0
MsgType = 1
Expiry = -1
Feedback = 0
Priority = 4
Persistence = 0
MsgId = 414d51204d514d494d53473032424b31b3bd714631050f20
CorrelId = 000000000000000000000000000000000000000000000000
BackoutCount = 0
ReplyToQ = ESB.REPLY
ReplyToQMgr = MQBK1
UserIdentifier = mqm
AccountingToken = 16010515000000cd79d57c274a9255474f7a595fbb000000000000000000000b
ApplIdentityData =
PutApplType = 11
PutApplName = _DELETE\\Desktop\\rfhutilc.exe
PutDate = 2007-07-17
PutTime = 18:50:44.260
ApplOriginData =
GroupId = 000000000000000000000000000000000000000000000000
MsgSeqNumber = 1
Offset = 0
MsgFlags = 0
OriginalLength = -1
MQRFH2
XMLNS
Envelope
\n
Body
\n
Message
\n
\n
LocalEnvironment
ComIbmAggregateControlNode
aggregateName = GPS_AGG
Environment
Variables
SOA
WestfieldStyleSheetDirectory = /home/wmqi/Stylesheets
DocumentNamespace =
replyMsgId = 414d51204d514d494d53473032424b31b3bd714631050f20
ReplyFormat = MQRFH2
DocumentName = Message
Root
Properties
MQMD
SourceQueue
Transactional
Encoding
CodedCharSetId
Format
MQRFH2
Version
Report
MsgType
Expiry
Feedback
Priority
Persistence
MsgId
CorrelId
BackoutCount
ReplyToQ
ReplyToQMgr
UserIdentifier
AccountingToken
ApplIdentityData
PutApplType
PutApplName
PutDate
PutTime
ApplOriginData
GroupId
MsgSeqNumber
Offset
MsgFlags
OriginalLength
XMLNS
Envelope
\n
Body
\n
ExceptionList



Let me know if I oversee something.

Thanks.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 17, 2007 11:01 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You seem to have two MQMD and MQRFH2 trees in there.

This might be part of the problem.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 18, 2007 2:46 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Let me be candid.
You are sending a JMS message over MQ. You are not setting any specific values to the RFH2 header.
Why add an RFH header at all? The JMS consumer will not care whether there is an RFH header or not....

Have fun
_________________
MQ & Broker admin
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 » IBM MQ Java / JMS » MQ JMS error while reading a message off the queue
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.