How to let publishers buffer locally if a subscriber is offline?

I asked the same question in another thread, but it might have been buried/have too much information:

We have a setup where there are many publishers connected to our broker (lets say to topic sensors/weather/[sensor-id]), and a subscriber to process all this incoming data and store it in a database.

We want to make sure these publishers buffer their data locally when this subscriber is offline, or if this subscriber can’t offload to the database.

The publishers we are using are both devices fully developed by us and off-the-shelf devices. We would like both of these to buffer when needed.

Is this something that is possible, and what would be the best way to go about this? Is it perhaps possible to auto-reject all messages sent to sensors/weather/# when the subscriber for this topic is offline?