Author |
Message
|
VijayGoparaju` |
Posted: Wed Oct 29, 2008 9:23 pm Post subject: Attaching a Header for a MQ-Message |
|
|
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 |
|
 |
Gaya3 |
Posted: Wed Oct 29, 2008 10:03 pm Post subject: |
|
|
 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 |
|
 |
VijayGoparaju` |
Posted: Wed Oct 29, 2008 10:54 pm Post subject: |
|
|
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 |
|
 |
David.Partridge |
Posted: Thu Oct 30, 2008 12:20 am Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Thu Oct 30, 2008 2:34 am Post subject: |
|
|
 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 |
|
 |
zpat |
Posted: Thu Oct 30, 2008 3:37 am Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Thu Oct 30, 2008 4:57 am Post subject: |
|
|
 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 |
|
 |
zpat |
Posted: Thu Oct 30, 2008 12:49 pm Post subject: |
|
|
 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 |
|
 |
bruce2359 |
Posted: Thu Oct 30, 2008 3:04 pm Post subject: |
|
|
 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 |
|
 |
|