I’ve encountered a problem when using small rye reactive messaging with Quarkus, for a rabbit MQ incoming handler.
The message being published to rabbit has a json content type, and the method signature of the handling code is written accordingly:
@Incoming("event-name") @Acknowledgment(Acknowledgment.Strategy.POST_PROCESSING) public void processEvent(final JsonObject payload)
However, in the event that the message body contains bad json, that cannot be parsed successfully, this method is never invoked and a
io.vertx.core.json.DecodeException is thrown, when handling the failure this calls into the
io.smallrye.reactive.messaging.providers.extension.HealthCenter.reportApplicationFailure() which then means the healthcheck endpoint will product a DOWN response. The app in question runs in k8s, so the pod gets restarted, but the new instance will pick up on the same message and produce the same. The only way to deal with the issue seems to be manually remove the bad message from the queue.
Looking in the docs quarkus.io/guides/rabbitmq-reference#health-reporting it suggests that a failed message should be nacked and the
failure-strategy should handle it, but it seems because the message isn’t being parsed properly, it isn’t getting as a far as the processing, the the failure strategy isn’t being called.
I’m actually not certain if this is the intended behaviour in this circumstance, if I can do something about it or if it genuinely is a bug – using Quarkus 2.12.0.
My expectation is that it should be possible to handle this circumstance in some way without causing the health check to fail and dequeueing the message so that the bad message isn’t picked up again and again.
Read more here: Source link