jeudi 25 juin 2015

Out of order messages with jboss

We have faced an issue in the message driven bean level. That is when multiple messages are arrived to the MDB at the same time, will process out of order.

eg:

Original order of the messages : Message 1, Message 2, Message 3

But in the application level onMessage() method we received the messages in incorrect order.

eg: Message 2, Message 1, Message 3

We are using the EJB3 message driven annotations in our MDB while Jboss version is Jboss EAP 6.4

  @MessageDriven(activationConfig = { 
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),

        @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/Queue1"),

        @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),

        @ActivationConfigProperty(propertyName = "reconnectAttempts", propertyValue = "-1"),

        @ActivationConfigProperty(propertyName = "minSessions", propertyValue = "1"),

        @ActivationConfigProperty(propertyName = "maxSessions", propertyValue = "1"),

        @ActivationConfigProperty(propertyName = "maxMessagesPerSessions", propertyValue = "1"),

        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")}, name = "MessageDrivenBeanEJB")

But the requirement is messages arrived to application original order as received to the Jboss Application server.

How can sorted this out?

Aucun commentaire:

Enregistrer un commentaire