Skip to content
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

Problem with chaining .merge() #94

Closed
dgodovanets opened this issue Jan 31, 2019 · 1 comment
Closed

Problem with chaining .merge() #94

dgodovanets opened this issue Jan 31, 2019 · 1 comment

Comments

@dgodovanets
Copy link

dgodovanets commented Jan 31, 2019

I've faced a really weird problem when merging streams: merging requires a kafka streams reference on the left-hand merger. By documentation, it had to work. I tried to use other method. Joining streams gives either the same error or not implemented error.

Here's my code part:

const {KafkaStreams} = require("kafka-streams");
const kafkaStreams = new KafkaStreams(config.kafkas);

const stream_1 = kafkaStreams.getKStream(config.kafka.topics[0]);
const stream_2 = kafkaStreams.getKStream(config.kafka.topics[1]);
const stream_3 = kafkaStreams.getKStream(config.kafka.topics[2]);
const stream_4= kafkaStreams.getKStream(config.kafka.topics[3]);
var mergedStream = stream_1
  .merge(stream_2)
  .merge(stream_3) // Error arises at this line
  .merge(stream_4);

By documentation, from .merge(stream) should be returned an object which can be treated both as a stream or a table. Also, .merge(stream) should work fine on a table also

I use npm@6.7.0, node@11.8.0 and kafka-streams@4.8.0

Upd: creating new KafkaStreams for each stream, giving them unique groupId didn't solve the problem

@krystianity
Copy link
Member

should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants