-
Notifications
You must be signed in to change notification settings - Fork 1
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
Multiple StreamsRegistry in same application #3
Comments
Hey there @AntoineDuComptoirDesPharmacies, That seems like a bug to me! You should be able to have multiple instances of the streams agent configured. There are two patterns for using the streams agent: Pattern 1: using a single You should be able to use a single import io.operatr.kpow.StreamsRegistry;
// Your Kafka Streams topology
Topology topologyA = createMyTopology();
Topology topologyB = createMyOtherTopology();
// Your Kafka Streams config
Properties props = new createMyStreamProperties();
// Your Kafka Streams instance
KafkaStreams streamsA = new KafkaStreams(topology, props);
KafkaStreams streamsA = new KafkaStreams(topology, props);
// Create a kPow StreamsRegistry
StreamsRegistry registry = new StreamsRegistry(props);
// Register your KafkaStreams and Topology instances with the StreamsRegistry
registry.register(streamsA, topologyA);
registry.register(streamsB, topologyB);
// Start your Kafka Streams application
streams.start(); Pattern 2: creating multiple import io.operatr.kpow.StreamsRegistry;
// Your Kafka Streams topology
Topology topologyA = createMyTopology();
Topology topologyB = createMyOtherTopology();
// Your Kafka Streams config
Properties props = new createMyStreamProperties();
// Your Kafka Streams instance
KafkaStreams streamsA = new KafkaStreams(topology, props);
KafkaStreams streamsA = new KafkaStreams(topology, props);
// Create a kPow StreamsRegistry
StreamsRegistry registryA = new StreamsRegistry(props);
StreamsRegistry registryB = new StreamsRegistry(props);
// Register your KafkaStreams and Topology instances with the StreamsRegistry
registryA.register(streamsA, topologyA);
registryB.register(streamsB, topologyB);
// Start your Kafka Streams application
streams.start(); This pattern should also be supported, but is looking to cause a runtime exception for you. We will try and reproduce and get a fix for you. In the meantime, if you can try and re-usue a single instance of |
Hi,
We are currently using
StreamsRegistry
to monitor a KafkaStream in our application.We would like to add a new KafkaStream in the same application and, for separation of concerns, we tried to create a new StreamsRegistry for this second stream. However, the registry crash on
register
with the following error :We are wondering if StreamsRegistry is meant to be instantiated only one time per application or if we did a mistake while declaring/using it ?
Thanks in advance for your answer !
Yours faithfully,
LCDP
The text was updated successfully, but these errors were encountered: