-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Topic messages API. Reactive consumer #50
Conversation
…eature/10-reactive-consumer-concept
kafka-ui-api/src/main/java/com/provectus/kafka/ui/cluster/service/ClusterService.java
Show resolved
Hide resolved
kafka-ui-api/src/main/java/com/provectus/kafka/ui/cluster/service/ClusterService.java
Show resolved
Hide resolved
private final KafkaCluster cluster; | ||
private final String topic; | ||
|
||
public void emit(FluxSink<ConsumerRecord<String, String>> sink) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll use Bytes,Bytes here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an early version of the backend for messages API and it supports only the simplest case. Will change that along with adding support of different message types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Properties props = new Properties(); | ||
props.put(ConsumerConfig.CLIENT_ID_CONFIG, "kafka-ui"); | ||
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, cluster.getBootstrapServers()); | ||
props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be Bytes Serde
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, but with BytesDeserializer. BytesSerde doesn't implement required interfaces.
} | ||
|
||
private void assignPartitions(KafkaConsumer<String, String> consumer, String topic) { | ||
List<TopicPartition> partitions = consumer.partitionsFor(topic).stream() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get number of partitions from internal state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* Topic messages API. Reactive consumer * Topic messages API. Reactive consumer * Review changes
Kudos, SonarCloud Quality Gate passed! |
No description provided.