quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.67k stars 2.65k forks source link

Kafka Health Check cannot be disabled #13920

Closed erard22 closed 3 years ago

erard22 commented 3 years ago

Describe the bug

In contrast to the documentation it seems the Kafka Health Check is not disabled by default. Even setting the proprety quarkus.kafka.health.enabled=false does not disable it.

Expected behavior

That the behaviour is consistent with the docuementation and the check can be disabled.

Actual behavior

I found no way to disable the check. This is important because my application has an online part and a async part, where we are processing kafka messages. The online part should stay online, event if there was a failing kafka message.

To Reproduce

I did a little demo project to reproduce the behaviour:

https://github.com/erard22/kafka-health-test

Configuration The current configuration of the demo project should disable the health check on both ways, Quarkus and Smallrye:

mp.messaging.incoming.demo.health-enabled=false
mp.messaging.incoming.demo.health-readiness-enabled=false
quarkus.kafka.health.enabled=false

Output

{
    "status": "DOWN",
    "checks": [
        {
            "name": "SmallRye Reactive Messaging - liveness check",
            "status": "DOWN",
            "data": {
                "application-ch.erard22.quarkus.DemoConsumer#consume": "[KO] - failed to process: Testmessage"
            }
        },
        {
            "name": "SmallRye Reactive Messaging - readiness check",
            "status": "DOWN",
            "data": {
                "application-ch.erard22.quarkus.DemoConsumer#consume": "[KO] - failed to process: Testmessage"
            }
        }
    ]
}

Additional context

For the Smallrye properties it sees to be working. Changing them to

mp.messaging.incoming.demo.health-enabled=true
mp.messaging.incoming.demo.health-readiness-enabled=true
quarkus.kafka.health.enabled=false

adds additional information to the health output, provided by Smallrye:

{
    "status": "DOWN",
    "checks": [
        {
            "name": "SmallRye Reactive Messaging - liveness check",
            "status": "DOWN",
            "data": {
                "application-ch.erard22.quarkus.DemoConsumer#consume": "[KO] - failed to process: Testmessage",
                "demo": "[KO] - failed to process: Testmessage"
            }
        },
        {
            "name": "SmallRye Reactive Messaging - readiness check",
            "status": "DOWN",
            "data": {
                "application-ch.erard22.quarkus.DemoConsumer#consume": "[KO] - failed to process: Testmessage",
                "demo": "[OK]"
            }
        }
    ]
}
ghost commented 3 years ago

/cc @jmartisk, @xstefank

xstefank commented 3 years ago

This seems specific to reactive messaging so can you try quarkus.reactive-messaging.health.enabled? Otherwise, I'll leave this to @cescoffier.

erard22 commented 3 years ago

You're right. Didn't find this in the specification, but it seems it's doing the job. Thanks!

effusion commented 2 years ago

Hey Guys,

I'm currently facing an issue with the health check. We have a Kafka ingest on which we receive JSON Message. Sometimes we get a malformed JSON and the Custom JacksonDesieralizer

class JsonDocumentDeserializer : ObjectMapperDeserializer<DocumentV12>(DocumentV12::class.java)

throws an exception turning the channel to KO and therefore the entire health to down.

I did try to disable the health check for this channel with mp.messaging.incoming.srf-cms-ingest-v12.health-enabled=false but it gets reported anyway. `"application-ch.srgssr.pdp.api.ingest.consumer.DocumentConsumer#receiveFromCMS": "[KO] - This consumer has already been closed." The only thing that helped was to disable the reactive-health completely withquarkus.reactive-messaging.health.enabled=false`

Hope this is enough information

Fyruz commented 11 months ago

Hey @effusion, maybe it is too late, but have you found any solutions to disable health just for the consumer you wanted? Thank you!

EDIT: I have the same problem as you. I opened a stackoverflow questions about it: stackoverflow

Kris3264 commented 8 months ago

Hey, @Fyruz, have you found any solutions to disable health just for the consumer you wanted?