In the GCP pub/sub documentation it says that messages sent to the topic before a subscription was created will not be sent to the subscription. I'm wondering if you have a topic that has no subscriptions bound but messages are being published to it and then a subscription is bound will the messages in the topic be sent to the newly bound subscription?
A second scenario would a topic with multiple subscriptions and messages are flowing through but say a new subscription is bound to that topic at 1:00 am. Is that subscription not eligble to receive any messages that were sent before 1:00 am?
Documentation I am referring to. https://cloud.google.com/pubsub/docs/subscriber
This is the statement I am referring to in particular
A message published before a given subscription was created will usually not be delivered for that subscription. Thus, a message published to a topic that has no subscription will not be delivered to any subscriber.
Note that it doesn't say "messages sent to the topic before a subscription was created will not be sent to the subscription," it says "A message published before a given subscription was created will usually not be delivered for that subscription." In other words, there are no guarantees one way or the other about what happens with messages published before.
The only guarantee that Cloud Pub/Sub makes is that messages published after the successful creation of the subscription will definitely be delivered to subscribers for that subscription. So in your first scenario, messages published after the subscription is created will be sent and ones published before may or may not. In the second scenario, messages published before 1am may or may not be delivered to subscribers for the subscription.