Skip to content

Bad Consumer implementation in KafkaConsumer Controller #2

@davidpestana

Description

@davidpestana

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions