Is your feature request related to a problem? Please describe.
There doesn't seem to be a way to unsubscribe from a topic in a consumer.
Describe the solution you'd like
I think there's two parts here: From a user point of view I would expect a thing having a 'subscribe' to also have a 'unsubscribe' concept. If that doesn't exist though I probably would want some form of documentation on why that is an unreasonable expectation, or what is needed to make this happen.
I can see one work-around: One could stop the consumer, then "move" over the interesting topics to a new consumer, and then start that one. But that also seems to indicate that KafkaJS could offer me that :)
So this is a bit of a discussion:
unsubscribe?FWIW: I think it would be "nice to have" an unsubscribe functionality, and I would assume that this basically boils down to implementing reasonable ways to change the target topics of a cluster and remove existing entries.
I would vote for yes. unsubscribe would be nice.
Imagine having some config storing which topics should be consumed. If that list changes it would be nice to be able to unsub, instead of restarting all consumers.
Most helpful comment
FWIW: I think it would be "nice to have" an unsubscribe functionality, and I would assume that this basically boils down to implementing reasonable ways to change the target topics of a cluster and remove existing entries.