Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JMS - Message redelivery

843830Jun 26 2006 — edited Jun 30 2006
I have created an MDB which has has an onMessage method that executes code that processes the message. Should the processing fail then a custom failure exception is caught and runTimeException is thrown causing the message to be redelivered. I currently have the redeliverylimit on the MDB's template through the weblogic console set to 3 redelivery attempts with the message eventaully sent to a posion queue after the final delivery attempt. This all works fine. I can send an email every time the message is processed but my problem is that I require an email to be sent on the last redelivery attempt. How can I do this? I could possibly set properties in the message each time it is delivered acting as a count? How could I read the max delivery attempts that I have set up through the console? (Otherwise I will have to set up another property loaded on startup of the managed server but this means the same value stored in two separate places)

Any Help? This is one of my first posts so any advice suggestions are welcome?

Message was edited by:
CaptainRhino

Comments

843830
Because you're rolling back and using your JMS Provider to move the message to a poison queue on the 3rd attempt I don't think you'll be able to change the message properties - the rollback will essentially undo them.

A few options spring to mind (some of which probably won't be appropriate)...

1. First thing I'd look at is whether you can monitor the poison queue - if the queue depth changes you know you need to send an email. If you need to copy details out of the message then this becomes a little more tricky as you have to browse the queue rather than consume messages from it.

2. There are commericial alerting applications which allow you to supress alerts until a threshold has been reached. They probably wouldn't work with email though (SMNP Traps is more likely).
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 28 2006
Added on Jun 26 2006
1 comment
142 views