How to customize Quarkus Bare Kafka?

83 views
Skip to first unread message

David Hoffer

unread,
Oct 1, 2021, 10:33:47 AM10/1/21
to Quarkus Development mailing list
I'm reviewing the kafka-bare-quickstart example but have several questions.

The example here is very basic, it seems we have one global (singleton) KafkaConsumer, KafkaProducer & AdminClient all using the same config from application.properties.  That won't work in my case as I need each usage to be customizable.  E.g. for some consumers we might use Kafka to store the offset and others its someplace else, plus all the various config options may be tuned for each use case.  So I'm left with the following questions.

1. How to customize the KafkaConsumer, KafkaProducer & AdminClient for each use case?

2. How does the @Identifier("default-kafka-broker") tie to the application.properties? I don't see any reference to that identifier in the file.  How can I have other identifiers and reference other config values?

3. Is there an example of using Quarkus & Bare Kafka with a more robust/full featured use case with various config options?

-Dave




Thomas Qvarnstrom

unread,
Oct 4, 2021, 3:40:21 AM10/4/21
to dhof...@gmail.com, Quarkus Development mailing list
Maybe not everything you asked for, but this should explain how @Identifier and the configuration works: https://smallrye.io/smallrye-reactive-messaging/smallrye-reactive-messaging/3.4/kafka/kafka.html#kafka-consumer-rebalance-listener

Cheers
Thomas


On Fri, Oct 1, 2021 at 4:33 PM David Hoffer <dhof...@gmail.com> wrote:
I'm reviewing the kafka-bare-quickstart example but have several questions.

The example here is very basic, it seems we have one global (singleton) KafkaConsumer, KafkaProducer & AdminClient all using the same config from application.properties.  That won't work in my case as I need each usage to be customizable.  E.g. for some consumers we might use Kafka to store the offset and others its someplace else, plus all the various config options may be tuned for each use case.  So I'm left with the following questions.

1. How to customize the KafkaConsumer, KafkaProducer & AdminClient for each use case?

2. How does the @Identifier("default-kafka-broker") tie to the application.properties I don't see any reference to that identifier in the file.  How can I have other identifiers and reference other config values?

3. Is there an example of using Quarkus & Bare Kafka with a more robust/full featured use case with various config options?

-Dave




--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/a73cfef7-534f-4d92-a6fd-278fc93d8a4bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages