Author |
Message
|
Abhinav_jain |
Posted: Mon Jan 15, 2007 7:51 am Post subject: HOW to Set MQMD Attributes |
|
|
Newbie
Joined: 15 Jan 2007 Posts: 6
|
Hi ,
I need to Set the format Attibute of MQMD to Apply DLH to the messages getting redireted to Dead letter queue how to go for it |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jan 15, 2007 7:59 am Post subject: Re: HOW to Set MQMD Attributes |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Abhinav_jain wrote: |
Hi ,
I need to Set the format Attibute of MQMD to Apply DLH to the messages getting redireted to Dead letter queue how to go for it |
Why? Any message the queue manager puts to the DLQ will have a DLH & appriopriate format set automatically (setting the format does not apply the DLH as you seem to infer).
If you have application driven dead letter handling, these messages should be put to a separate queue and not the sysytem one.
To answer your question, you simply move the correct literal into the MQMD.Format field (MQMF_DEAD?? Maybe - check it out!) using the application programming language of your choice. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
KevinF23492 |
Posted: Mon Jan 15, 2007 8:06 am Post subject: |
|
|
Novice
Joined: 26 Dec 2006 Posts: 22
|
What?
Messages that are placed into the DLQ by the QMgr will already have a DLH on them.
If you just want to browse the DLQ and see what the errors were then there is a support pack that you can use to browse these in ISPF.
If you want to have a Dead Letter Handler then there is already you provided by IBM (CSQUDLQH) |
|
Back to top |
|
 |
Abhinav_jain |
Posted: Thu Jan 18, 2007 2:46 am Post subject: Setting MQDLH by an Application |
|
|
Newbie
Joined: 15 Jan 2007 Posts: 6
|
Hi
Thanks for your replies. Actually, in our case, an application(Siebel) is putting the messages on to the Dead Letter Queue. Probably this is the reason that when we ran the runmqdlq command it says "AMQ8721: Dead-letter queue message not prefixed by a valid MQDLH".
We have the MQ setup on Solaris Platform. Is there any way to see the Header on the messages on this platform, becoz we are not able to check what kind of Header is there on the message.
Also please tell us the way the application can pre-append the MQDLH to the Message before putting it onto the DLQ.
Thanks,
Abhi |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 18, 2007 3:02 am Post subject: Re: Setting MQDLH by an Application |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Abhinav_jain wrote: |
Hi
Thanks for your replies. Actually, in our case, an application(Siebel) is putting the messages on to the Dead Letter Queue. Probably this is the reason that when we ran the runmqdlq command it says "AMQ8721: Dead-letter queue message not prefixed by a valid MQDLH". |
I'd have said that.
Abhinav_jain wrote: |
We have the MQ setup on Solaris Platform. Is there any way to see the Header on the messages on this platform, becoz we are not able to check what kind of Header is there on the message.
|
Any of the standard tools will do it, or you can browse them from a command line.
Abhinav_jain wrote: |
Also please tell us the way the application can pre-append the MQDLH to the Message before putting it onto the DLQ.
|
Two points. First, the DLH is "just" another header (like an RFH2) and can be added by the application code. Check the Application Programming Guide / Reference for details of the structure.
Secondly, as I've said before applications should not write to the system dead letter queue. This should be reserved for actual system undeliverable messages. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
KevinF23492 |
Posted: Thu Jan 18, 2007 5:59 am Post subject: Re: Setting MQDLH by an Application |
|
|
Novice
Joined: 26 Dec 2006 Posts: 22
|
Vitor wrote: |
Secondly, as I've said before applications should not write to the system dead letter queue. This should be reserved for actual system undeliverable messages. |
I absolutely agree with this. Why can't the application drop dead messages onto its own application 'dead queue'? Is it purely to utilise the DLQ handler program without having to write your own? IIRC the DLQ handler programs can access any queue and process the messages, but this does require that they have correct formed DLH on them. The SDLQ is, as Vitor correctly (IMHO) points out, should be left for the SYSTEM's use only.
What causes the messages to be trying to hit DLQ in the first place? A business logic error (program error or a data error) in the application, and or a system failure? The answer to this question will (or should) ultimately determine the best destination for the 'failed' message.  |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 18, 2007 6:02 am Post subject: Re: Setting MQDLH by an Application |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
KevinF23492 wrote: |
IIRC the DLQ handler programs can access any queue and process the messages, but this does require that they have correct formed DLH on them. |
That's my belief as well. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Abhinav_jain |
Posted: Thu Jan 18, 2007 6:13 am Post subject: Setting MQDLH by application |
|
|
Newbie
Joined: 15 Jan 2007 Posts: 6
|
Hi,
Thanks again. I was able to see the header using amqsbcg from command line and I found the header in SYSTEM.DEAD.LETTER.QUEUE as:
MQGET of message number 2
****Message descriptor****
StrucId : 'MD ' Version : 2
Report : 0 MsgType : 4
Expiry : -1 Feedback : 0
Encoding : 273 CodedCharSetId : 1208
Format : 'MQSTR '
Priority : 0 Persistence : 0
MsgId : X'414D512042542E514D2E4254574C525345A3ACED2000EB01'
CorrelId : X'000000000000000000000000000000000000000000000000'
BackoutCount : 478
ReplyToQ : ' '
ReplyToQMgr : 'BT.QM.BTWLRSER2 '
** Identity Context
UserIdentifier : 'siebel '
AccountingToken :
X'0431303032000000000000000000000000000000000000000000000000000006'
ApplIdentityData : ' '
** Origin Context
PutApplType : '6'
PutApplName : 'siebprocmw '
PutDate : '20070116' PutTime : '14455919'
ApplOriginData : ' '
GroupId : X'000000000000000000000000000000000000000000000000'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '0'
OriginalLength : '-1'
**** Message ****
This was followed by the message. This message was put in the DLQ when the receiving application could not pick it up (its processing component was down. And in the Application, there is a parameter which if set, makes the application to rollback to the queue.) The message once rollbacked is not processed again as the BOTHRESH is set to 0 and there is no BOQNAME specified as well. So it is then putting the messages on the SYSTEM.DEAD.LETTER.QUEUE. My doubt is what puts the message onto the DLQ if the Application is not able to pick the messages from queue. Is it the queue Manager or the application? The above header does not seem to be the MQDLH as is expected in the DLQ messages.
Also, I saw a few posts and as you suggested had gone thru the Application Programming guide/reference. They tell about the MQDLH structure clearly. But nowhere, it says about how to set those values in the header parameters. Thats where I am stuck right now. In the above header, the Dest. Queue Manager, Dest. Queue and Reason are also not there which can be used in DLQ handler.
Also as you suggested, I have now made a separate Dead.Queue as the DLQ instead of using SYSTEM.DEAD.LETTER.QUEUE.
Thanks,
Abhi |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 18, 2007 7:14 am Post subject: Re: Setting MQDLH by application |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Abhinav_jain wrote: |
This was followed by the message. This message was put in the DLQ when the receiving application could not pick it up (its processing component was down. And in the Application, there is a parameter which if set, makes the application to rollback to the queue.)
|
So you have a design issue round the handling of failed messages. If the message fails because the content of the message causes the error it's a poison message and should be killed. If not, as in this case, it should just sit there until the application is ready.
Abhinav_jain wrote: |
My doubt is what puts the message onto the DLQ if the Application is not able to pick the messages from queue. Is it the queue Manager or the application? The above header does not seem to be the MQDLH as is expected in the DLQ messages. |
It's the application. The queue manager records but does not enforce these values. This is also why you don't get a DLH. All this is documented behaviour.
Abhinav_jain wrote: |
But nowhere, it says about how to set those values in the header parameters. Thats where I am stuck right now. |
You add the header & set the values according to whatever method is appropriate to your programming language. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Abhinav_jain |
Posted: Thu Jan 18, 2007 7:35 am Post subject: Adding DLH to a message |
|
|
Newbie
Joined: 15 Jan 2007 Posts: 6
|
Hi ,
Thanks for ur fast responses , can u suggest some possible ways by using which we can add DLH to message . Few things we found are that we can change some C programs which are with in the MQ, using MQ library and other which we can find out is using some Pipeline Component.
So can u suggest which one is best one to use. And some url which can help us implement the soultion.
Thanks,
Abhi |
|
Back to top |
|
 |
Vitor |
Posted: Thu Jan 18, 2007 7:42 am Post subject: Re: Adding DLH to a message |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Abhinav_jain wrote: |
Few things we found are that we can change some C programs which are with in the MQ, using MQ library and other which we can find out is using some Pipeline Component. |
If by "C programs which are within the MQ" you mean the channel exits, don't! They are not for the beginner and are not appropriate for your problem. If you know a MQ library function that does it, use it but I'm not aware of one. As to "Pipeline Component" I'm guessing this is a Siebel construct. I know slightly more about the dark side of the Moon than I do about Siebel & cannot speak authoratively, but the application is certainly the place to be doing this using whatever functions are relevant. For instance in a C program you'd define the structure and add it to the buffer.
With luck a Siebel person will be along in a minute. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Abhinav_jain |
Posted: Thu Jan 18, 2007 9:35 pm Post subject: some cocept about Pipeline component |
|
|
Newbie
Joined: 15 Jan 2007 Posts: 6
|
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Jan 19, 2007 1:15 pm Post subject: |
|
|
Guest
|
This has been stated in this and other posts. I'll restate it here.
The DLQ is not intended for your application use. It is used primarily by the MQ network agent MCA at the receiving end of a network connection as a place to put messages that can't be delivered to a destination queue. The DLQ is also used for failed data conversion at either end of a network, and for failures in triggering.
This subject is well covered in IBM documentation. Read the System Admin Guide, the Application Programmers Guide and Application Programmers Reference.
Applications needing to displose of unacceptable messages (messages not meeting business rules) should be put to an application-oriented queue to be processed by an application designed to deal with these messages.
There can only be one DLQ owned by a queue manager. Application programs dumping application messages in the DLQ might cause the DLQ to reach maxdepth and cause the message channel to fail.
This is bad application architecture. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Jan 19, 2007 7:12 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
 _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Abhinav_jain |
Posted: Sun Jan 21, 2007 1:43 am Post subject: Setting MQDLH by application |
|
|
Newbie
Joined: 15 Jan 2007 Posts: 6
|
Hi,
I agree with the statements, that application can clog the DLQ with the messages. Actually, here the idea is that whenever the Application is too loaded to process the messages, they can be put on a custom dead queue and then a DLQ handler will be run periodically to pick the messages and put them back onto the intended queues. This way the main queue will be free to accept messages continuously.
The problem we are facing is that the application is putting the messages on the Dead Queue and the MQDLH header is not coming. We need some way to prefix the message with the header. The application here is Siebel. We can do some scripting to do this. But we want to find out if setting up of MQMD parameters like format (or something else) can achieve this? or is there any way that we can make the Qmanager to prefix this header to the message.
Folks, really need your expert help for some resolution to this...
Thanks |
|
Back to top |
|
 |
|