What is the background of the requirement? Usually, we will not force to close the producer and consumer at the server-side, because we don't if the client-side can handle this case well.
Or, if the topic will retire, and you don't want the clients to connect to it, you can just terminate the topic. Thanks Penghui On Wed, Dec 29, 2021 at 10:39 AM 包子 <wudixiaolong...@icloud.com.invalid> wrote: > Issue: https://github.com/apache/pulsar/issues/13488 > > > 2021年12月29日 10:3812,包子 <wudixiaolong...@icloud.com> 写道: > > > > ## Motivation > > > > Broker send `CLOSE_PRODUCER/CLOSE_CONSUMER` to client when delete topic, > But client will be reconnect. If config `allowAutoTopicCreation=true` will > trigger create topic again. > > > > > https://github.com/apache/pulsar/blob/9f599c9572e5d9b1f15efa6e895e7eb29b284e57/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConnectionHandler.java#L130-L133 > > > > ## Goal > > > > Add new commands `STOP_PRODUCER/STOP_CONSUMER`, When the client receives > the command, it only closes without reconnecting. > > > > ## API Changes > > > > 1. Add command to `BaseCommand` > > ```java > > message BaseCommand { > > enum Type { > > // ... > > STOP_PRODUCER = 64; > > STOP_CONSUMER = 65 > > } > > } > > ``` > > > >