Search code examples
queueweblogicfifoosbjms-topic

How to make messages in a topic in weblogic server first in first out


I am using Oracle Fusion Middleware 12.1.3. Weblogic Server 12.1.3 and OSB 12.1.3. I have created 1 connection factory and one topic. I have one producer sending messages to the topic and 3 consumers(subscribers)

I have also set redelivery failure settings (retry 3 times every half hour) in case there is a connection error or network issue the messages will be written back to the topic and will be retried. but I want to make sure that the messages are retried in the same order that it was received. i.e. for example there are 3 messages in the topic (message 1, message 2, message 3) and one of the subscriber is not able to consume the message so the message is pending in the topic and it will be retried. but I want it to be retried in same order i.e. message 1, message2 and message 3.

Is there any specific setting to be done in weblogic or OSB to achieve this behavior


Solution

  • Have you tried using the weblogic-specific Unit of Order feature?

    What Is Message Unit-Of-Order?

    Message Unit-of-Order is a WebLogic Server value-added feature that enables a stand-alone message producer, or a group of producers acting as one, to group messages into a single unit with respect to the processing order. This single unit is called a Unit-of-Order and requires that all messages from that unit be processed sequentially in the order they were created.

    You can configure it programmatically for more control, or administratively (via WLS console, attaching one to connection factories etc) if you don't have control over the messages produced.

    For more info about how to attach the JMS headers to enable it, you might find this site helpful.