|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
  |
|
Reduce backout count in java - Need Help |
View previous topic :: View next topic |
Author |
Message
|
novice@mq |
Posted: Mon Feb 04, 2008 1:29 am Post subject: Reduce backout count in java - Need Help |
|
|
Newbie
Joined: 04 Feb 2008 Posts: 2
|
I have a MDB deployed on WAS. My requirement is to rollback a message to the original queue on encountering any error. However in case of few errors like - messaging errors 504 or 519 we want to send the message to an error Q instead of the original queue.
One option to implement this can be :
1) Set the backout threshold to 1.
2) If we encounted the error 504 or 519, the MDB issues a rolllback. MQ will set the message header the “backout” count to “1”,so it moves to the error queue.
3)If any other errors occur(apart from 504 or 519 like DB error etc) the MDB will need to set the backout count back to “0” and issue a rollback. This way the message will remain in the queue for reprocessing.
The question here is how to modify the backout count in the message header? Is there any methods for this in java?
Is there any other way to do this? Please let me know ASAP.  |
|
Back to top |
|
 |
Mr Butcher |
Posted: Mon Feb 04, 2008 2:02 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
i am not familiar with java, but the bacout counter is something that you GET from MQSeries, but nothing you can SET.
in addition - you wrote "It moves to the error queue". - a message with backout counter > backout threshold is not moved to the backout queue by MQSeries itself. You can inqure the backout threshold and backout queue name within your program, and compare it with the backout counter you get when getting the message, and put the message to the backout queue. but "you" must do that. MQ will not do it vor you. _________________ Regards, Butcher |
|
Back to top |
|
 |
novice@mq |
Posted: Mon Feb 04, 2008 2:52 am Post subject: |
|
|
Newbie
Joined: 04 Feb 2008 Posts: 2
|
I am using an container managed MDB .. so I think when i rollback a mesage and backout count > backout threshold , the container will automatically move the message to the error Q.. no explicit coding is required for this in the application |
|
Back to top |
|
 |
Vitor |
Posted: Mon Feb 04, 2008 3:07 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
novice@mq wrote: |
I am using an container managed MDB .. so I think when i rollback a mesage and backout count > backout threshold , the container will automatically move the message to the error Q.. no explicit coding is required for this in the application |
I think you're right, but be aware this is a function of the container not MQ.
I also agree with Mr Butcher that the backout count of a message can't be set by an application program, only retrieved. You can programatically change the backout threshold of a queue, but this requires an application running with administrative rights, which yours shouldn't be and if I was the MQ admin on your site wouldn't be!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 04, 2008 3:28 am Post subject: Re: Reduce backout count in java - Need Help |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
novice@mq wrote: |
I have a MDB deployed on WAS. My requirement is to rollback a message to the original queue on encountering any error. However in case of few errors like - messaging errors 504 or 519 we want to send the message to an error Q instead of the original queue. |
You cannot do that with the backout feature of the MDB.
What you can do is catch the 2 mentioned errors in the MDB and put the message to the error Q before exiting the MDB on a success path.
Now all other error codes will cause an MDB Exception and roll back.
The backout threshold will cause the MDB to retry:
on retry > backout threshold messages will be put to the backout queue and if there is none to the DLQ.
on retry <= backout threshold the MDB will stop once the retry count has been used.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
  |
|
Page 1 of 1 |
|
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
|
|
|
|