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 » Modifying MQMD Headers

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 Modifying MQMD Headers « View previous topic :: View next topic » 
Author Message
rsmile
PostPosted: Wed Feb 20, 2008 10:24 pm    Post subject: Modifying MQMD Headers Reply with quote

Apprentice

Joined: 13 Feb 2008
Posts: 38

I'm trying to modify MQMD headers in the output root.

I need to modify msgType,MsgId,CorrelId,GroupId & MsgSeqNumber inside the flow.

I have a clue that I need to get this done by changing MQRFH2 header.

Could some one tell me how to get this done?
Back to top
View user's profile Send private message
AJStar
PostPosted: Wed Feb 20, 2008 11:02 pm    Post subject: Reply with quote

Acolyte

Joined: 27 Jun 2007
Posts: 64

Code:
SET OutputRoot.MQMD.<whatever you want to modify> = <value>;


MQMD and MQRFH2 are separate entities.
Just look up the message tree structure in documentation.
_________________
Regards
AJ
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Feb 21, 2008 2:27 am    Post subject: Re: Modifying MQMD Headers Reply with quote

Grand High Poobah

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

rsmile wrote:
I have a clue that I need to get this done by changing MQRFH2 header.


It's not a clue, it's a red herring. Or a red trout, depending on who gave it to you...
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rsmile
PostPosted: Thu Feb 21, 2008 5:03 am    Post subject: Reply with quote

Apprentice

Joined: 13 Feb 2008
Posts: 38

Then how can I set the MsgId?
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Feb 21, 2008 5:07 am    Post subject: Reply with quote

Grand High Poobah

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

rsmile wrote:
Then how can I set the MsgId?


Using the code posted earlier in this thread.

I will repeat the often-repeated warning that setting either MsgId or CorrelId is a bad practice - I don't mean setting the CorrelId to an inbound MsgId for reply purposes but setting either to "ABCD1234" or similar.

Use the system facilities to generate such idents. It's much better and doesn't cause problems in the long run, as manually set ones inevitably do.

The Search Button will turn up any number of threads on the subject.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqmatt
PostPosted: Thu Feb 21, 2008 5:14 am    Post subject: Reply with quote

Grand Master

Joined: 04 Aug 2004
Posts: 1213
Location: Hursley, UK

You can also change values in the MQMD without resorting to ESQL; try the Transport Header Nodes Supportpac IA9S (http://www.ibm.com/support/docview.wss?rs=171&uid=swg24016629&loc=en_US&cs=utf-8&lang=en)
This is a relatively new supportpac; I'd be interested in your feedback.
Back to top
View user's profile Send private message
rsmile
PostPosted: Thu Feb 21, 2008 5:18 am    Post subject: Reply with quote

Apprentice

Joined: 13 Feb 2008
Posts: 38

I Tried to implement the code that was posted,

Quote:

CREATE NEXTSIBLING OF OutputRoot.MQMD DOMAIN 'MQRFH2' NAME 'MQRFH2';
DECLARE newMsgId CHARACTER '54545464646464646464646';
SET OutputRoot.MQMD.MsgId = CAST( newMsgId AS BLOB CCSID InputRoot.Properties.CodedCharSetId);


I'm getting a parser exception saying that length must be correct.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Feb 21, 2008 5:22 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

What is the proper length for an MQMD.MsgID field?

What is the proper length for a hex character representation of a binary string of that length?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
rsmile
PostPosted: Thu Feb 21, 2008 5:24 am    Post subject: Reply with quote

Apprentice

Joined: 13 Feb 2008
Posts: 38

when I checked the help system, it gave the type for MsgId as MQBYTE24.

I believe the length should be 24.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Feb 21, 2008 5:30 am    Post subject: Reply with quote

Grand High Poobah

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

rsmile wrote:
I Tried to implement the code that was posted


No you didn't. The code posted didn't mention CREATE at all.

And if the field length is 24, why have you specified the wrong length literal?

I repeat my comments about not setting the field manually. This sort of thing keeps happening. What requirement are you trying to satisfy, that calls for the id to be set? There are very, very few valid reasons for doing it (I repeat the search suggestion).
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
rsmile
PostPosted: Thu Feb 21, 2008 5:38 am    Post subject: Reply with quote

Apprentice

Joined: 13 Feb 2008
Posts: 38

Vitor,

I understand what you are saying, this is not the preferred way of setting the message id.

I'm unaware of setting the values using system facilities.So was doing this!

This is my code now, my literal is of length 24.

Quote:
DECLARE newMsgId CHARACTER '35343534353436343634363';
SET OutputRoot.MQMD.MsgId = CAST( newMsgId AS BLOB CCSID InputRoot.Properties.CodedCharSetId);
Back to top
View user's profile Send private message
rsmile
PostPosted: Thu Feb 21, 2008 5:39 am    Post subject: Reply with quote

Apprentice

Joined: 13 Feb 2008
Posts: 38

Could you please help me in understanding how to set the msgid using system utilities?
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Feb 21, 2008 5:46 am    Post subject: Reply with quote

Grand High Poobah

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

rsmile wrote:
Could you please help me in understanding how to set the msgid using system utilities?


It's a setting on the MQOutput node, equivalent to the put option NEW_MSG_ID.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Feb 21, 2008 5:48 am    Post subject: Reply with quote

Grand High Poobah

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

rsmile wrote:
This is my code now, my literal is of length 24.


Which is still too short - the MsgId is NOT a character field. Attempts to treat it as such will only accelerate your slide towards doom!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Feb 21, 2008 5:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

What requirement are you trying to fulfill, that you're trying to set these?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 of 3

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Modifying MQMD Headers
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.