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

Programatically adding kafka consumers #321

Open
ckosmowski opened this issue Feb 11, 2021 · 4 comments
Open

Programatically adding kafka consumers #321

ckosmowski opened this issue Feb 11, 2021 · 4 comments
Labels
help wanted Extra attention is needed type: enhancement New feature or request

Comments

@ckosmowski
Copy link
Contributor

The use of @KafkaListener annotation is very convenient if we use the micronaut-kafka api directly. However if we want so provide our own classes that offer pre-configured kafka consumers we would have to implement the poll loop ourselfs allthough all the beautiful code is already there in KafkaConsumerProcessor.

I'd like to suggest a feature where we would be able to add a preconfigured kafkaConsumer to KafkaConsumerProcessor that reuses the code that is already there in the process() method but takes the configuration that is handed as parameters instead as the annotation information.

As a more specific example we'd like to be able to have a KafkaListener where offsetStrategies and all the parameters are configured, also the KafkaListenerException handler is set properly. The User (i.E. Developers of other teams) should then be able to just specify a topic, a groupId and how they'd like to process the messages. They shouln't care for committing or resetting offsets in case of an Exception or such things. This would be a great benefit for us.

@graemerocher
Copy link
Contributor

Sounds like a nice idea. PRs are of course welcome 🙏

@ckosmowski
Copy link
Contributor Author

If "PRs" is short for prayers i'll send you some. If you mean pull requests this feature might actually be a good one to start contributing. I'll do my very best.

@graemerocher graemerocher added type: enhancement New feature or request help wanted Extra attention is needed labels Apr 25, 2021
@mcac0006
Copy link

I've been using micronaut-kafka for 2 years but this is the first time I would be contributing to the code base. Nonetheless, I would like to lend a hand.

However if we want so provide our own classes that offer pre-configured kafka consumers we would have to implement the poll loop ourselfs allthough all the beautiful code is already there in KafkaConsumerProcessor.

This would help - do you happen to have a code snippet please?

@awattez
Copy link

awattez commented Jan 8, 2023

hello, I find this feature very useful in a reactive context, it is the exact definition of reactive.

Let's imagine creating consumers on the fly in order to react to a message or other... do you have any news or leads for implementing programmatic consumers that will be accessible through the ConsumerRegistry and other useful components of micronaut-kafka?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants