3
votes

In the Google Cloud Pub/Sub documentation about load balancing in pull delivery say:

Multiple subscribers can make pull calls to the same "shared" subscription. Each subscriber will receive a subset of the messages.

My concern is about the last phase. Can I decide the way to partition the topic? In others words, Can I decide the way the subsets are grouped?

For instance, in the Kinesis AWS service I can decide the partition key of the stream, in my case by user id, in consequence, a consumer recibe all the messages of a subset of users, or, from other point of view, all the messages of one user are consumed by the same consumer. The message stream of one user is not distributed between different consumers.

I want to do this kind of partition with the Google Pub/Sub service. Is that possible?

1

1 Answers

3
votes

There is currently no way for the subscriber to specify a partition or set of keys for which they should receive messages in Google Cloud Pub/Sub, no. The only way to set up this partition would be to use separate topics.