ActiveMQ Artemis AMQ219016 and AMQ219006 when consuming/producing messages

Viewed 45

We have built a "buffer like" queue for ordering messages, we will "loop" through all message in the queue until we find the next one in the order. We consume a message and if it is not the right one we publish it back to the same queue. This works well, but sometimes we receive a AMQ219006: Channel disconnected and right after AMQ219016: Connection failure detected. Unblocking a blocking call that will never get a response. I have read this post activemq-artemis-producer-fails-with-jmsexception-amq219016 and wonder if this problem could be solved with "high availability".

I also suspect that this network issue could be caused by the fact that I have 3 instances of the same application attempting to publish and consume messages from the same one queue at once?

Im using Artemis 2.17.0

2 Answers

Neither AMQ219006 nor AMQ219016 can be resolved with a "high availability" (i.e. HA) configuration. The underlying cause for these messages is explained on the answer you cited. HA won't fix that.

How do you identify a message being the right one / being the next one? If it is a custom message property, you could skip this consuming and putting back messages cycle by using a message selector (specifying the expected value for this property) to consume the right message right away. If it is not a message property, might it be feasible to redesign and let the producer of the message add this ordering information into such a custom message property? This won't avoid receiving the error situations you describe entirely. But it seems you are doing plenty of potentially redundant queuing activity due to your application design, which also increases the risk you are within a transaction which cannot be continued when a failover occurs on broker level leading to the exceptions you currently face occasionally.

Related