0

Every time I restart the PubSub emulator, the topics/subscriptions are gone. Currently, I have a script that creates the topics and subscriptions each time the emulator starts:

https://stackoverflow.com/a/56994166/1237919

Is this state not persisted? Is there a way to persist state?

jacob
  • 2,460
  • 1
  • 17
  • 43

1 Answers1

3

The emulator runs in memory; state is not persisted across runs. If you want to persist state, you will need to use the real Cloud Pub/Sub service. You could instead re-create your topics and subscriptions each time you start the emulator to get to the desired starting state.

Lauren
  • 754
  • 3
  • 8