Skip to content
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

Pass Kafka heartbeat callback to Kafka endpoints #9949

Closed
1 task done
kosh-b opened this issue Jul 18, 2022 · 0 comments
Closed
1 task done

Pass Kafka heartbeat callback to Kafka endpoints #9949

kosh-b opened this issue Jul 18, 2022 · 0 comments
Labels
needs triage This issue has not been looked into type: enhancement 🐺

Comments

@kosh-b
Copy link
Contributor

kosh-b commented Jul 18, 2022

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

According to kafkajs documentation When having long handling time for a Kafka message, you should call the heartbeat callback or increase the session timeout (which will effect other flows - such as rebalance time).

Tag 8.4.5 includes a major bump of kafkajs package (1.1.6 -> 2.0.0).
In v2.0.0 of kafkajs the user gets heartbeat callback in the callback they register in the eachMessage function, but this callback is not passed to endpoint so we can't explicitly call to Kafka heartbeat when having long handling time.

Describe the solution you'd like

KafkaContext (the object passed to the endpoint) should have the heartbeat callback added.

KafkaContext is being created when handling new Kafka message at server-kafka.js, in this context the "payload" param already contains the heartbeat, so it should not change any actual api between nestjs <--> kafkajs (only to add the heartbeat to "EachMessagePayload" - which is already being asked in another issue: #9947).

Teachability, documentation, adoption, migration strategy

See above for code reference

What is the motivation / use case for changing the behavior?

Allow to sent heartbeat explicitly from long timed Kafka endpoints, in order to not exceed the session timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into type: enhancement 🐺
Projects
None yet
Development

No branches or pull requests

2 participants