Hello guys greetings Please is there a way I can s...
# general
o
Hello guys greetings Please is there a way I can specify subscription, consumer and topic name to stop an active consumer via pulsar rest api or pulsar client library ? apparently the below code is not doing it
Copy code
async consumer({
    topic,
    subscriptionName,
    consumerName,
  }: {
    topic: string;
    subscriptionName: string;
    consumerName?: string;
  }): Promise<Pulsar.Consumer> {
    const consumerConfig: Pulsar.ConsumerConfig = {
      topic: topic,
      subscription: subscriptionName,
    };
    if (consumerName) {
      consumerConfig["consumerName"] = consumerName;
    }

    return await this.client.subscribe(consumerConfig);
  }
}
The above throws the following error
Copy code
[Error: Failed to create consumer: ConsumerBusy]
@David K