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

Cannot read property 'take' of null on KStream.stream$ #168

Open
zeeshanalisyed opened this issue Aug 25, 2020 · 2 comments
Open

Cannot read property 'take' of null on KStream.stream$ #168

zeeshanalisyed opened this issue Aug 25, 2020 · 2 comments
Labels

Comments

@zeeshanalisyed
Copy link

zeeshanalisyed commented Aug 25, 2020

I am trying to close the Stream on the given object by calling close function on the instance of class KStream but receiving this error:

Cannot read property 'take' of null on KStream.stream$

I've also debugged that KStream.stream$ contains null value.

this.stream$ = this.stream$.take(0);

import { KafkaStreams as Factory, KafkaStreamsConfig, KStream } from "kafka-streams";

interface ZStream extends KStream {
    started: boolean; 
}

let client = new Factory(Config as KafkaStreamsConfig);

let stream = client.getKStream("test");

async function Tester() {
  const started = await stream.start();
  console.log((stream as ZStream).started); // output: true
  const closed = await stream.close()
  console.log((stream as ZStream).started); // output: true which should be false
  const startagain = await stream.start();
  console.log(startagain); // output: Promise.reject => KStream is already started
  const closeagain = await stream.close(); //this part sometimes create problem
}
Tester();
@rob3000 rob3000 added the bug label Aug 27, 2020
@rob3000
Copy link
Member

rob3000 commented Aug 27, 2020

Hi @zeeshanalisyed thanks for the report. Are you able to provide me with a code sample of what you have so we can replicate it?

@zeeshanalisyed
Copy link
Author

Hi @zeeshanalisyed thanks for the report. Are you able to provide me with a code sample of what you have so we can replicate it?

I have added the code above first of all this is produced by using client and stream as a part of the class, stream is not closed at all. but when I use class instance as a wrapper of the stream then that error is produced this is the transformed code from the real code

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

No branches or pull requests

2 participants