This message was deleted.
# general
s
This message was deleted.
e
stop all the consumers
unload the topic (pulsar-admin topics unload)
that should work
but it is kind of a hack
you should drop the subscription and create a new one
l
whoo @Enrico Olivelli lot of work to update the subscription!!!
is it possible to do this without using pulsar-admin?
e
in theory you shouldn’t change the subscription type
you can restart the brokers
because the “type” is only set in memory the first type a Consumer connects
so if you disconnect all the consumers and you reset the status by bouncing the brokers that will work
at least for the current Pulsar versions
but it is a hack
d
Would pausing all of the active consumers work as well @Enrico Olivelli ?
e
you have to disconnect them
I am not sure that “pausing” is enough, is “pausing” is the Consumer API in Java
do you have to do it in Production ?
d
Yes, it is in the Java consumer API.
e
you can try it with pulsar standalone locally if “pausing” is enough
btw this is a trick and it is not guaranteed to work with future Pulsar versions
hopefully one day we will store the “type” in the Subscription metadata
you can switch from Exclusive/Failover to Shared/KShared, but I don’t think it will work as expected in the opposite direction
(because Exclusive doens’t have individual acks)
d
I guess the question I have is what are you changing on the subscription? The list of topics it is consuming from? Perhaps a regex pattern would be a better approach?
e
@Lalit Gangwar is talking about the “Type”, so I guess he means “Exclusive/Failover/Shared/KeyShared”
Maybe I misunderstood 😓
d
I thought the question was about Topics. @Lalit Gangwar, can you clarify please?
l
@Enrico Olivelli @David K sorry I was in meeting. I don't want to change type of subscription. I want to change number of topics which consumer subscribes to. I can't use regex as topic names are not in similar pattern
d
In that case, I would suggest running a quick test against a standalone Pulsar instance. Keep it simple and try to go from 1 topic to 2. But I think you will have to close the old consumer and create a new one in order to change the configs, but you can reuse the same subscription name, etc.
l
ok I will try it.