Skip to content

Commit

Permalink
Document io.factorhouse.kpow.StreamsRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
wavejumper committed Dec 19, 2024
1 parent a4f8f96 commit 53adbe1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/java/io/factorhouse/kpow/StreamsRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ public StreamsRegistry(Properties props) {
this(props, MetricFilter.defaultMetricFilter());
}

/**
* Registers a Kafka Streams application with Kpow's StreamsRegistry.
*
* @return a StreamsAgent instance for the registered application (used to unregister).
*/
public StreamsAgent register(KafkaStreams streams, Topology topology, KeyStrategy keyStrategy) {
IFn require = Clojure.var("clojure.core", "require");
require.invoke(Clojure.read("io.factorhouse.kpow.agent"));
Expand All @@ -103,6 +108,10 @@ public StreamsAgent register(KafkaStreams streams, Topology topology, KeyStrateg
}
}

/**
* Unregisters a Kafka Streams application with Kpow's StreamsRegistry. Use the StreamsAgent instance returned from
* the register method.
*/
public void unregister(StreamsAgent streamsAgent) {
if (streamsAgent != null) {
IFn require = Clojure.var("clojure.core", "require");
Expand Down

0 comments on commit 53adbe1

Please sign in to comment.