-
-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kafka microservice health check does not work #1690
Comments
Hi if there is anything I can provide for this issue please let me know |
Hi @jirawat-tokenx, I advise you to leave a minimal reproduction of a clonable git repository so that the core team can evaluate the problem you have reported. |
This is also the case for me out of the box, however, I can get a successful response by increasing the timeout directly in the options (I can't see this in the options you shared @jirawat-tokenx) This is what I'm doing to make it work. const kafkaOptions = {
transport: kafkaConfig.transport,
options: kafkaConfig.options,
timeout: 10000,
};
this.microservice.pingCheck<KafkaOptions>('Kafka', kafkaOptions) That being said, the response time is unmanageable. A ping check that is taking ~10 seconds to give back a response is absolutely way too much. Is that something that can be looked at @Tony133? For context, |
Hi @fer8a, i think maybe that's something that can be improved, however if you can create a minimal reproduction in a clonable git repository the Nest Core Team can better assess the issue. |
Hello @Tony133 sorry for the late reply. It's been some busy days. Take a look at the following respository |
Hi all, I tried @fer8a minimum reproduction, I did some tests setting the timeout up to while setting the timeout on 5200 and increasing it, the status check works correctly (see screenshot): This is a brief summary of the test I took. P.s. For the Kafka service I used a docker container. |
Hi everyone. I found that kafka pingCheck works if added Example:
|
@Tony133 If you have time, please check https://github.com/jlahtinen/nestjskafkaterminus I think this is about as simple as it can get to reproduce described problem. I have not idea how to fix this. If |
Hi @jlahtinen, I tried your minimal reproduction in a local environment with docker and managed to get it working, but I had to increase the timeout to I attach here two screenshots: I hope I have been of some help |
@Tony133 Thank you. Works as you described. |
A big problem with this is that the check creates a new connection, causing Kafka to rebalance the consumers, then closes it, which triggers another rebalance. I think, it's an issue with the approach itself: instead of checking if the existing connection is healthy, the indicator checks if Kafka is connectable, so we don't really know if the microservice itself is still connected. |
Yeah, I agree that it's not actually terminus issue. It's natural state of things for Kafka. @Tony133 I'd probably consider introducing default config for Kafka transport consumer config with |
Released with v10.1.0 🎉 |
Is there an existing issue for this?
Current behavior
Configuring a microservice ping check, like:
The check will alway return "timeout of
x
ms exceeded" whatever how many timeout will be set.But my service still working well with the same Microservice config.
Minimum reproduction code
Steps to reproduce
No response
Expected behavior
Health check should be return
UP
status when the kafka is able to connectPackage version
8.0.4
NestJS version
8.2.6
Node.js version
14.17.3
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: