Replies: 2 comments 11 replies
-
If you are using Spring Boot; you can use the auto configured
As we state in the documentation: https://docs.spring.io/spring-kafka/docs/current/reference/html/#configuring-topics
|
Beta Was this translation helpful? Give feedback.
-
Thanks for showing me right documentation chapter. Should AdminClient be permanent Spring bean or created ad-hoc per request? AdminClient is thread safe: looks like something designed to be permanent... |
Beta Was this translation helpful? Give feedback.
-
My application needs:
In PartitionFinder example one-time consumer is used:
try (Consumer<String, String> consumer = consumerFactory.createConsumer()) {
If want use this pattern beyond application initialization, I have doubts:
synchronized
or something similar?Consumer
when I do not consume anything? I see that Spring providesKafkaAdmin
. Admin sounds better than consumerKafkaAdmin
does not expose everything Kafka can provide. It seems Spring Kafka designers decide to expose limited features. Should I raise a ticket: please add partition offsets to KafkaAdmin? Does not look smart that for every feature exposed by Kafka separated ticket to KafkaAdmin must be raisedorg.apache.kafka.clients.admin.Admin
Sounds good. Rich API comparing to KafkaAdmin. That looks like something I should use. But how arrange Admin in Spring Application?
KafkaAdmin use one-time
org.apache.kafka.clients.admin.Admin
. Is that reasonable? I found in https://stackoverflow.com/a/57047821/2365727Considering all above, I think Kafka Admin should have reusable
org.apache.kafka.clients.admin.Admin
and expose it to allow application ask Kafka for everythingBeta Was this translation helpful? Give feedback.
All reactions