Reputation: 67
What is the partition strategy if n subscriber is sharing 1 subscriptions for a topic in google pub/sub?
Is it round robin? Or does each subscriber guarantee to have a set of key if there is no rebalancing?
Upvotes: 1
Views: 3328
Reputation: 3037
PubSub lite has a concept of partitions it seems.
https://cloud.google.com/pubsub/lite/docs/topics#provisioning_capacity
https://cloud.google.com/pubsub/lite/docs/subscribing#receiving_messages
To receive messages from a Lite subscription, request messages from the Lite subscription. The client library automatically connects to the partitions in the Lite topic attached to the Lite subscription. If more than one subscriber client is instantiated, messages will be distributed across all clients. The number of partitions in the topic determines the maximum number of subscriber clients that can simultaneously connect to a subscription.
Upvotes: 2
Reputation: 75790
You can create several subscriptions on a same topic with a filter on the message attributes to only select a subset of messages.
You can't set partition based on the subscribers of a same subscription.
Upvotes: 3