Skip to content

Commit

Permalink
Merge pull request #46576 from dcotfr/issues-40315-and-41432
Browse files Browse the repository at this point in the history
makes Kafka Streams topology optional
  • Loading branch information
ozangunalp authored Mar 3, 2025
2 parents 335c4a9 + 614d0f0 commit 503e496
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.regex.Pattern;
import java.util.stream.Stream;

import jakarta.enterprise.inject.Instance;
import jakarta.inject.Inject;

import org.apache.kafka.streams.Topology;
Expand All @@ -16,11 +17,16 @@

public class KafkaStreamsJsonRPCService {
@Inject
Topology topology;
Instance<Topology> topologyProvider;

@NonBlocking
public JsonObject getTopology() {
return parseTopologyDescription(topology.describe() != null ? topology.describe().toString() : "");
var topologyDescription = "";
if (topologyProvider.isResolvable()) {
final var describe = topologyProvider.get().describe();
topologyDescription = describe != null ? describe.toString() : "";
}
return parseTopologyDescription(topologyDescription);
}

JsonObject parseTopologyDescription(String topologyDescription) {
Expand Down

0 comments on commit 503e496

Please sign in to comment.