user16367669
user16367669

Reputation: 67

Does google pub/sub have concept of partition like kafka?

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

Answers (2)

Hitobat
Hitobat

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

guillaume blaquiere
guillaume blaquiere

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

Related Questions