简体   繁体   中英

Failure retry in EJB 3

We have recently migrated our EJB 2 application to EJB 3.In EJB2 if some failures in onMessage container will be able to do retry the message on configured number of times however in EJB3 there is no such option.Could someone help on this.

Can we explicitly sleep the thread and do explicitly retry in onMessage?

Thanks in advance .

  1. If you are using @TransactionManagement(value= TransactionManagementType.CONTAINER) that is container managed transaction then on exception, message will be retired 10 time before the message is send to the DLQ.
  2. If you are not using Activemq RA then, following two documents can be useful to you if you are having Container-Managed Transaction Redelivery and Exception Handling and Managing Rolled Back, Recovered, Redelivered, or Expired Messages
  3. If you are using ActiveMq resource adapter, use can use MaximumRedeliveries Resource Adapter properties
  4. Else, if you want to retry only on specific exception then you can catch the exception and then send the message back to the same queue and with this additional property. Activemq consume message after delay interval Also, set the retry count in the message header so that you can keep the track of the retries.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM