Skip to content

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

Open
@zeeshanalisyed

Description

@zeeshanalisyed

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions