Skip to content

Commit

Permalink
Deprecate io.operatr.kpow.StreamsRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
wavejumper committed Dec 18, 2024
1 parent b6f6b02 commit 1c702e7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,12 @@ If you have set a UI-friendly cluster name using the `ENVIRONMENT_NAME` environm

```java

import io.factorhouse.kpow.key.ManualKeyStrategy;

// This sets a manual key of `Trade Book (Staging)`, the name of the clusters environment name in Kpow's UI.
KeyStrategy keyStrategy = new ManualKeyStrategy("Trade Book (Staging)");
registry.register(streams, topology, keyStrategy);
registry.

register(streams, topology, keyStrategy);
```

### Minimum Required ACLs
Expand Down
14 changes: 0 additions & 14 deletions src/java/io/factorhouse/kpow/key/ManualKeyStrategy.java

This file was deleted.

11 changes: 9 additions & 2 deletions src/java/io/operatr/kpow/StreamsRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import clojure.java.api.Clojure;
import clojure.lang.IFn;
import io.factorhouse.kpow.MetricFilter;
import io.factorhouse.kpow.key.KeyStrategy;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.common.serialization.Serializer;
import org.apache.kafka.streams.KafkaStreams;
Expand All @@ -11,6 +12,12 @@
import java.util.ArrayList;
import java.util.Properties;


/**
* @deprecated This class is no longer recommended for use.
* Please use {@link io.factorhouse.kpow.StreamsRegistry} instead.
*/
@Deprecated
public class StreamsRegistry implements AutoCloseable {

public static class StreamsAgent {
Expand Down Expand Up @@ -91,11 +98,11 @@ public StreamsRegistry(Properties props) {
this(props, MetricFilter.defaultMetricFilter());
}

public StreamsAgent register(KafkaStreams streams, Topology topology) {
public StreamsAgent register(KafkaStreams streams, Topology topology, KeyStrategy keyStrategy) {
IFn require = Clojure.var("clojure.core", "require");
require.invoke(Clojure.read("io.factorhouse.kpow.agent"));
IFn registerFn = Clojure.var("io.factorhouse.kpow.agent", "register");
String id = (String) registerFn.invoke(agent, streams, topology);
String id = (String) registerFn.invoke(agent, streams, topology, keyStrategy);
if (id != null) {
return new StreamsAgent(id);
} else {
Expand Down

0 comments on commit 1c702e7

Please sign in to comment.