Author |
Message
|
zen |
Posted: Wed Jun 14, 2006 1:23 am Post subject: Poison Messages in MQ |
|
|
Apprentice
Joined: 11 May 2005 Posts: 32 Location: Singapore
|
Hi all,
Just wanted to ask what are the possible reasons or cause of poison messages in MQ? Currently, one of our MDB application is encountering a transaction rollback exception (see exception below). Though, we can resolve this by increasing the max retry, we would like to know and resolve if possible the cause of the poison message. This is because we would like the message to be delivered to all our recipients, instead of placing the poison msg in the dead queue. Below is our setup.
SETUP:
We have an MainFrame MQ that receives the message, then an MDB that listens for messages fetches the messages and then sends out email. The message placed in the queue is just a one long message, where included inside the message are all the recipients. The weird thing is that the delivery fails (and poison msg is created) when the recipients is greater than 500. If the recipient is below that, then no poison msgs are created.
Thank you very much.
WMSG0031E: Exception processing JMS Message for MDB MDBSendMail, JMSDestination jms/mdb/MDBSendMailRequestQ : javax.ejb.TransactionRolledbackLocalException: ; nested exception is: com.ibm.ws.exception.WsEJBException
com.ibm.ws.exception.WsEJBException
at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapException(LocalExceptionMappingStrategy.java:159)
at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapCSITransactionRolledBackException(LocalExceptionMappingStrategy.java:293)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3111)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:102)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:373)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
javax.ejb.TransactionRolledbackLocalException: ; nested exception is: com.ibm.ws.exception.WsEJBException
at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapCSIException(LocalExceptionMappingStrategy.java:96)
at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapException(LocalExceptionMappingStrategy.java:165)
at com.ibm.ejs.container.LocalExceptionMappingStrategy.mapCSITransactionRolledBackException(LocalExceptionMappingStrategy.java:293)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3111)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:102)
at com.ibm.ejs.container.MDBWrapper.onMessage(MDBWrapper.java:127)
at com.ibm.ejs.jms.listener.ServerSession.run(ServerSession.java:373)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code)) |
|
Back to top |
|
 |
Mr Butcher |
Posted: Wed Jun 14, 2006 1:47 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
what is a "poison message"? where does it reside? mq does not create "poison messages" ....... _________________ Regards, Butcher |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 14, 2006 2:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
So, what you're saying is, your java code throws an exception when you try to send an email to more than 500 recipients, and this causes the MDB to rollback the message.
And you haven't configured a backout queue, so the MDB retry doesn't move the message off the input queue, so it continues to retry on the same message until the MDB Listener port shuts down?
I'd start by seeing why your code throws an exception with more than 500 recipients. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
zen |
Posted: Wed Jun 14, 2006 4:15 am Post subject: |
|
|
Apprentice
Joined: 11 May 2005 Posts: 32 Location: Singapore
|
Hi jefflowrey,
Yes, I know that and I could configure a backout queue to catch the poison msg. But my question is that what causes a poison message anyway? I mean we'd rather solve the problem that causes the poison message rather than catering for the after effect of handling the poison msg. As I understand, if in the event that the poison msg still failed to be delivered after 5 retries, then the msg will be discarded or put to the dead queue and so the msg will not received by the recipient which we might not be aware of.
So just wanted to ask some ideas on some common reasons for a poison msg and we'll try to resolve it. But in the same time, we'll configure a backout queue to resolve poison msgs.
Thanks a lot. |
|
Back to top |
|
 |
EddieA |
Posted: Wed Jun 14, 2006 10:05 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
But my question is that what causes a poison message anyway |
Your receiving application does, or the sending application, not MQ. To MQ, the message is just a string of bits that are delivered.
The definition, that I've always understood, is that a poison message is one that your application can't process for some reason. So, either fix the sending application to send what you expect, or work out why the receiving application can't process the message it has.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 14, 2006 11:00 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
jefflowrey wrote: |
I'd start by seeing why your code throws an exception with more than 500 recipients. |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 14, 2006 11:01 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Also, poison messages have, in my experience, one and only one cause in MQ.
The sending application and the receiving application. Either the sending application has created bad data, or the receiving application is not written correctly for the data it should be receiving. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Jun 14, 2006 1:42 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I've also seen them because of some kind of resource constraint. The application can't process the message and ends up rolling it back. It eventually gets moved as poison. Unfortunately, the next message in the queue usually ends up with the same fate..... |
|
Back to top |
|
 |
zen |
Posted: Wed Jun 14, 2006 5:38 pm Post subject: |
|
|
Apprentice
Joined: 11 May 2005 Posts: 32 Location: Singapore
|
Hi everyone,
Thanks a lot for the input. I'll check with our developers and let them review their codes/programs for sending and receiving. I'll get back to you with the updates.
Regards,
Zen |
|
Back to top |
|
 |
kschyuan |
Posted: Thu Jun 15, 2006 6:05 pm Post subject: more than 500 receipients - posion message |
|
|
Newbie
Joined: 12 Jun 2006 Posts: 4
|
Hi, I have exactly the same problem.
Such a coincidence.
When it's more than 500 receipients, the message get roll back.
so far no solution yet. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Jun 15, 2006 7:19 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
Is there not any kind of WMQ error? |
|
Back to top |
|
 |
kschyuan |
Posted: Sun Jun 18, 2006 6:53 pm Post subject: |
|
|
Newbie
Joined: 12 Jun 2006 Posts: 4
|
Interestingly. We change the transaction attributes to "NotSupported" in our coding and it works.... |
|
Back to top |
|
 |
zen |
Posted: Sun Jun 18, 2006 7:30 pm Post subject: |
|
|
Apprentice
Joined: 11 May 2005 Posts: 32 Location: Singapore
|
Hi kschyuan,
I'm glad to hear you were able to make your application work. May I know where & how did you change the transaction attribute so that we may try it ourselves? In which class has this transaction attribute? If it's ok, may I request you to post a snippet of the code where you changed the attribute.
Thanks a lot. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jun 19, 2006 2:36 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
zen wrote: |
Hi kschyuan,
I'm glad to hear you were able to make your application work. May I know where & how did you change the transaction attribute so that we may try it ourselves? In which class has this transaction attribute? If it's ok, may I request you to post a snippet of the code where you changed the attribute.
Thanks a lot. |
Would that be on the mail session by any chance ? _________________ MQ & Broker admin |
|
Back to top |
|
 |
kschyuan |
Posted: Thu Jun 22, 2006 6:05 pm Post subject: |
|
|
Newbie
Joined: 12 Jun 2006 Posts: 4
|
Hi, we just added in this small chunk of codes :
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>SystemProcessMail</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor> |
|
Back to top |
|
 |
|