-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add capability to add topic configuration during topic creation #35824
Conversation
...ons/kafka-client/runtime/src/main/java/io/quarkus/kafka/client/runtime/KafkaAdminClient.java
Show resolved
Hide resolved
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.
LGTM from a Dev UI perspective. I would also ask @ozangunalp and/or @cescoffier to have a look from a feature p.o.v
This comment has been minimized.
This comment has been minimized.
...ons/kafka-client/runtime/src/main/java/io/quarkus/kafka/client/runtime/KafkaAdminClient.java
Show resolved
Hide resolved
...ons/kafka-client/runtime/src/main/java/io/quarkus/kafka/client/runtime/KafkaAdminClient.java
Show resolved
Hide resolved
Collection<String> topics = new ArrayList<>(); | ||
topics.add(name); | ||
DeleteTopicsResult dtr = client.deleteTopics(topics); | ||
return dtr.topicNameValues() != null; | ||
} | ||
|
||
public boolean createTopic(KafkaCreateTopicRequest kafkaCreateTopicRq) { | ||
public boolean createTopic(final KafkaCreateTopicRequest kafkaCreateTopicRq) { | ||
var partitions = Optional.ofNullable(kafkaCreateTopicRq.getPartitions()).orElse(1); | ||
var replications = Optional.ofNullable(kafkaCreateTopicRq.getReplications()).orElse((short) 1); |
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.
If you use the dev service, I don't believe you can use more than 1, as there is a single node.
So, we may want to disable that option in this case.
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.
Can you clarify what you mean by "disabling the option"?
Are you asking if to remove the default value?
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.
Yes, or add a message in the UI.
...ons/kafka-client/runtime/src/main/java/io/quarkus/kafka/client/runtime/KafkaAdminClient.java
Show resolved
Hide resolved
...-client/runtime/src/main/java/io/quarkus/kafka/client/runtime/devui/KafkaJsonRPCService.java
Show resolved
Hide resolved
...-client/runtime/src/main/java/io/quarkus/kafka/client/runtime/devui/KafkaJsonRPCService.java
Show resolved
Hide resolved
...-client/runtime/src/main/java/io/quarkus/kafka/client/runtime/devui/KafkaJsonRPCService.java
Show resolved
Hide resolved
fb7d3c2
to
89af2b0
Compare
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.
Nice addition, but it needs some work for the UI field for topic config input.
@@ -59,6 +59,14 @@ export class QwcKafkaAddTopic extends LitElement { | |||
min="0" | |||
max="99"> | |||
</vaadin-integer-field> | |||
<vaadin-text-field |
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 don't think that field would work to populate configs
as Map<String, String>
.
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.
...ons/kafka-client/runtime/src/main/java/io/quarkus/kafka/client/runtime/KafkaAdminClient.java
Show resolved
Hide resolved
@ozangunalp @phillip-kruger @cescoffier it would be great to finalize this PR. |
@gsmet I believe it would need to be rewritten. |
@ozangunalp What do you think about this one? Should we rework it or close it? |
@ozangunalp Can you check my last comment? |
I'll give a quick look to that branch. Maybe it is not that far from complete. |
This comment has been minimized.
This comment has been minimized.
@ozangunalp can you squash the commits? |
Status for workflow
|
Updated the
createTopic
method in theKafkaAdminClient
class to accept an optional configs parameter in the form of a Map<String, String>.This parameter allows users to specify custom configuration settings for the Kafka topic.