Friday, March 9, 2012

Enabling WebLogic JMS queues for retries

Oracle WebLogic Server 11g (10.3.5+) provides you the ability to configure an error destination for your JMS destination.

1. Create a JMS queue and call it AhmedQueue. This is your primary queue.

2. Create another JMS queue can call it AhmedQueueError. This is your error queue. Message that fail to be delivered will be put here.

3. In the WebLogic Admin Console, navigate to JMS Modules > (your JMS module name) > AhmedQueue > Configuration > Delivery Failure.

4. Enter the following information:
Redelivery Delay Override:    Number of milliseconds to wait before retrying.
Redelivery Limit:                  Number of times to retry.
Expiration Policy:                Set this to 'Redirect'.
Error Destination:                The name of your error queue (e.g., AhmedQueueError).

5. If you have a Mediator component that reads from the queue, you can see how it retries 5 times before giving up and putting the message in the error queue:


6. If you have a BPEL component that reads from the queue, you can see how it retries 5 times before giving up and putting the message in the error queue:


7. However, in BPEL code, you must add the following property in your component in your composite.xml:
<component name="AhmedConsume" version="2.0">
  <implementation.bpel src="AhmedConsume.bpel"/>
  <property name="bpel.config.oneWayDeliveryPolicy" type="xs:string">sync</property>
</component>

Applicable Versions:
  • Oracle WebLogic Server 11g
  •  
References
  • http://docs.oracle.com/cd/E14571_01/integration.1111/e10224/soa_transactions.htm#CHDIDBEI

Ahmed Aboulnaga

6 comments:

Anonymous said...

Ahmed, How is the going behave when we set JCA retry properties? do JCA properties take priority over queue parameters? For example, if the JCA retry is set to 15 sec, how will it retry?

Thanks/Chandra

Ahmed Aboulnaga said...

Good question. I have not tested it out but will do so soon.

Theoretically, both will take effect, with the JCA properties taking effect first. If the JCA retries fail and the message is rolled back to the JMS destination, then the destination properties should kick in afterwards.

Ahmed Aboulnaga said...

Chandra,

Check out the following blog post:

http://blog.ipnweb.com/2012/03/explaining-jms-and-jca-retries.html

Ahmed Aboulnaga said...

Also, for those considering using WebLogic JMS retries, please note that messages that fail due to a "bindingFault" are not persisted in the error destination but messages that fail due to a "remoteFault" are.

Anonymous said...

Thanks Ahmed, I read your latest blog about setting JCA retry and JMS retry.

Thanks/Chandra

Siva Balan said...

Ahmed, I tried the same way as you did but with a small change. I had a Web-service in the reference pane.Not Db adapter. So, when the endpoint of WS is not available, the faults should be passed back the JMS and it should retry for configured time. But it is not working. It stops in the first try and the faults are transferred to JMS saying 'oracle.fabric.common.FabricInvocationException'. Can you help me to make it work??/