I have an application that produces messages to Pulsar under a specific topic and shut down the application when it's finished; at the same time, no consumer exists to read this topic.
After a while, when I create a consumer and want to read the written data out, I found all data are lost since the topic I've written been deleted by Pulsar.
How can I disable the auto-deletion of inactive topics in Pulsar?
Generally, there are two ways to achieve this.
pulsar-admin
to infinite at the namespace level. pulsar-admin namespaces set-retention my-tenant/my-ns \
--size 1T \
--time -1
brokerDeleteInactiveTopicsEnabled=false
in conf/broker.conf
could disable the deletion of inactive topics as well.It's recommended to set the above two settings simultaneously for proper control.