I am using Kafka ingoing message connector to accept messagges coming from a kafka topic. Sometimes error happen (sigh) and I would like to disable health check on this message connector only. I have tried many configurations but any can satisfy what I need to do.
This is the message connector (ActionDlqConnector.java):
@NonBlocking
@ActivateRequestContext
@Incoming("actions-dlq-in")
@Retry(maxRetries = 1, jitter = 1000L, delay = 2000L)
@Acknowledgment(Acknowledgment.Strategy.PRE_PROCESSING)
public Uni<Void> onMessage(ConsumerRecord<String, ActionKafkaDTO> rejected) {
log.info(String.format("Received dlq action: %s %s %s",
rejected.topic(), rejected.partition(), rejected.offset()));
return sessionFactory.withTransaction(session -> {
log.info(String.format("Re-processing action: %s", rejected.value()));
return service.processAction(rejected.value(), kafkaMessageTime(rejected), session)
.onFailure()
.invoke(e -> log.log(Level.SEVERE, "Error saving action from dlq", e));
});
}
This my actual app configuration of this connector:
mp:
messaging:
outgoing:
...
incoming:
actions-dlq-in:
topic: mytopic
connector: smallrye-kafka
failure-strategy: ignore
consumer-rebalance-listener:
name: consumer-seek.rebalancer
health-readiness-enabled: false
health-liveness-enabled: false
health-enabled: false
Using this settings, when reaching http://localhost:8080/q/health
(after the error happened) I still see:
{
"status": "DOWN",
"checks": [
{
"name": "SmallRye Reactive Messaging - liveness check",
"status": "DOWN",
"data": {
"application-com.mycompany.events.kafka.consumer.ActionDlqConnector#onMessage": "[KO] - No result found for query [FROM com.mycompany.events.model.Event WHERE eventKey = ?1]"
}
},
]
}
It seems that error is not exactly on the connector actions-dlq-in but it is that class connector.
I also checked on internet and found nothing that could fix this issues.
I need to keep the health status as UP even if an error occurs on that connector.