Google PubSub Lite one subscriber with multiple partitions

25 Views Asked by At

I wanted to understand what is the behaviour of Google PubSub Lite when there is only 1 subscriber subscribed to a topic that has 2 partitions.

Whether the subscriber receive the data from both the available partitions or it would only receive the data from only one partition and data would pile up in the other partition?

I read through the documentation but could not find a clear answer.

1

There are 1 best solutions below

0
Kamal Aboul-Hosn On

If there is a single subscriber client, it will get data from both partitions. Partitions are spread out among available clients. From the documentation:

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.