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 API Support » Attaching a Header for a MQ-Message

Post new topic  Reply to topic
 Attaching a Header for a MQ-Message « View previous topic :: View next topic » 
Author Message
VijayGoparaju`
PostPosted: Wed Oct 29, 2008 9:23 pm    Post subject: Attaching a Header for a MQ-Message Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

Hello,
I have a problem with the Messages.I have to attach a Header to each message which I am sending.How to attach a Header to each message and send that message to the Queue?
Please Help me,
Thanks,
Vijay.
Back to top
View user's profile Send private message
Gaya3
PostPosted: Wed Oct 29, 2008 10:03 pm    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

the message will be attached with MQMD ,

you can think of Pay load (RFH/RFH2) properties
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
VijayGoparaju`
PostPosted: Wed Oct 29, 2008 10:54 pm    Post subject: Reply with quote

Acolyte

Joined: 26 Aug 2008
Posts: 72

Thanks for your reply but,
Will that Header be attached automatically by the Queue Manager or our program has to do that?These are some headers: MQMD,MQXQH,MQDLH..etc..
Thanks.
Vijay...
Back to top
View user's profile Send private message
David.Partridge
PostPosted: Thu Oct 30, 2008 12:20 am    Post subject: Reply with quote

Master

Joined: 28 Jun 2001
Posts: 249

To put a message you have to use an MQMD and that is "associated" with the message on the queue. Any other MQ headers your application requires need to be part of your message payload, and its up to you to create them.

Normally the only ones you might need to concern yourself with are the MQMDE (if using a version 1 MD and segmentation), MQCIH (if sending messages to CICS bridge), the IMS header if talking to IMS, and possibly MQHRF2 if not using XMS/JMS to talk to pub-sub.

You should never need to concern yourself with creating dead letter headers or transmission queue headers.
_________________
Cheers,
David C. Partridge
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Oct 30, 2008 2:34 am    Post subject: Reply with quote

Grand High Poobah

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

VijayGoparaju` wrote:
Will that Header be attached automatically by the Queue Manager or our program has to do that?These are some headers: MQMD,MQXQH,MQDLH..etc..


No, You'll have to insert the RFH2 Header yourself. Note that from an MQ point of view a message is an MQMD and data, even if you add an RFH2. At a queue level it's part of the application data, so there's no reason (if you're not using WMB) why you couldn't have your "header" as part of your application data and not use any format you like.

DO NOT attempt to put business data in the MQMD, MQXQM, MQDLH or any of the system generated headers. There are some fields in the MQMD which are not used by the system and could hold a small amount of data. It's not best practice though & you're better off on your current plan of adding a header.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zpat
PostPosted: Thu Oct 30, 2008 3:37 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

David.Partridge wrote:

You should never need to concern yourself with creating dead letter headers or transmission queue headers.


I would have to differ. If your application ever moves a poison message to the DLQ or to a queue performing a similar function, you should add a DLH.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Oct 30, 2008 4:57 am    Post subject: Reply with quote

Grand High Poobah

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

zpat wrote:
David.Partridge wrote:

You should never need to concern yourself with creating dead letter headers or transmission queue headers.


I would have to differ. If your application ever moves a poison message to the DLQ or to a queue performing a similar function, you should add a DLH.


I would have to differ with that. Poison messages should never be moved to the DLQ. This queue is for undevliverable messages, and poison messgaes are delivered.

I can see that you might want something like a DLH on a poison message but an actual DLH is probably overkill.

And you never want to fiddle with the transmission header.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
zpat
PostPosted: Thu Oct 30, 2008 12:49 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

I think adding a DLH is a good idea, many message display / error handling tools support it and we use our own reason codes.

If it's good enough for IBM, it's good enough for us!
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Oct 30, 2008 3:04 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Something DLH-like as a header in a dead-letter-like-queue (not the system dlq) seems more appropriate for not-really-dead messages.

A poison message is really an otherwise good business message that the consuming applicatoin could not successfully process. This type of message should be moved to a queue where an applicaiton that is designed to reprocess (or re-distribute) can do so.

As an example: an application expects time-card messages, but finds an inventory request message. What reason-code in a real DLH would address this?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
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 » IBM MQ API Support » Attaching a Header for a MQ-Message
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.