0
votes

I am trying to setup a camel context that polls a weblogic jms queue, consumes the message and sends it to a webservice endpoint. Incase any error occurs in the transaction or the target system is unavailable, I need to redeliver the same message without losing sequence/ordering.

I have set up a camel jms route with single consumer and enabled transacted attribute as per https://camel.apache.org/transactional-client.html and set the redelivery as unlimited.

When the transaction fails with messageA, the jms message consumption from weblogic queue is rollbacked and the messageA is marked for redelivery (state string is marked delayed) in weblogic. But during this time if another message reaches the weblogic queue, the camel route picks the messageB and forwards it to the target endpoint although the messageA is still in retrying mode. This distorts the whole ordering of the messages.

The transaction client is used to ensure that messages are not lost while the application is shutdown during redelivery.

I expect that there are no message loss and the messages are always sent in the correct order as per generated into the weblogic queue to the target endpoint.

1

1 Answers

1
votes

That a newly arrived message outpaces an existing message that has to be redelivered, sounds like a broker (Weblogic) issue or feature.

I never saw this behavior with ActiveMQ. A failed message that is redelivered, is redelivered immediately by the Apache broker.

It sounds like the message is "put aside" internally to redeliver it later. This can absolutely make sense to avoid blocking message processing.

Is there something like a "redelivery delay" set on Weblogic you can configure? I could imagine that a delayed redelivery is like an internal error queue with a scheduled consumer.