JetStreamContext.subscribe() and JetStreamContext.pull_subscribe() ignore "durable_name" from ConsumerConfig when looking up for consumer info. #603
Labels
defect
Suspected defect such as a bug or regression
Observed behavior
When
.subscribe()
or.pull_subscribe()
methods of JetStreamContext are provided withconfig
parameter which hasdurable_name
parameter set, those methods ignore it and usedurable
parameter of methods themselves.Which may results in following JS error if consumer does not exist and parameter
name
was not specified onConsumerConfig
, which is not required by the NATS server:Expected behavior
My expectations for those methods were that they would use "durable_name" parameter from
ConsumerConfig
in order to create a consumer / lookup existing consumer.I can see the logic of not using
ConsumerConfig
if the consumer is already created and thus passingdurable
toJetStreamContext
methods so it is used to lookup for already created consumer.But I believe this behaviour is unclear. If user provides config - config values should be used OR they should be overrided by
.evolve()
as it's done in other methods.I think it's better to use provided config, because it opens the possibility to update consumer config automatically as it is requested in #503.
Server and client version
Server: docker image: nats:latest
Client: nats-py==2.7.2
Host environment
docker run -d --name durable -p 4222:4222 nats -js
Steps to reproduce
The text was updated successfully, but these errors were encountered: