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

Bad Consumer implementation in KafkaConsumer Controller #2

Open
davidpestana opened this issue Apr 26, 2019 · 0 comments
Open

Bad Consumer implementation in KafkaConsumer Controller #2

davidpestana opened this issue Apr 26, 2019 · 0 comments

Comments

@davidpestana
Copy link

davidpestana commented Apr 26, 2019

image

If you activate the 'consumer.on message' event, this never ends, you will hear the messages until eternity.

Although there is a consumer, the closure of something happens with the life cycle and the consumer's problems a little more after sending the response.

Maybe I should wait for the consumer.close callback to issue the answer.

Therefore, if the controller issues his response and after this, the listener adds a new message to the response, we will get this error.

By definition, the consumer of Kafka behaves like a service or a demon and must start as a process at the beginning of the application.

Could you explain the best practice to do this? In loopback 3 we would use 'boot' directory to add a file with this responsibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant