Can we use Custom FlowControl (https://cloud.google.com/pubsub/docs/publisher#flow_control) and Concurrency Control (https://cloud.google.com/pubsub/docs/publisher#concurrency) with message ordering enabled ?
What is the impact or any scenarios that we should be careful of while doing so ?
Good day @ankit-pradhan ,
Welcome to Google Cloud Community!
This is possible but this will be depending on your use case, just take note that Flow Control will allow you to limit the messages of the subscriber. For example, one subscriber has a lot of backlog messages due to repeated extension of acknowledgement deadline, this might cause the other subscriber unable to receive the message even if the subscriber has the capacity. Additionally, it will consume more CPU and memory until the subscriber runs out of resources.) In order to reduce these issues, Flow control can be used, it will remove unwanted cost and increase . If you will be using concurrency control, it will let you optimize the application by adjusting the threads or streams. (For example, the subscriber can optimize the application by increasing the thread count if it is unable to keep up with the volume of messages and is not CPU-bound and you can decrease the threads to optimize the application if the messages are CPU intensive). If you enable the ordering, just take note that Pub/Sub will deliver the oldest message up to newest which might increase the latency.
You can check out this link to learn more: https://cloud.google.com/pubsub/docs/flow-control
https://cloud.google.com/pubsub/docs/concurrency-control
https://cloud.google.com/pubsub/docs/ordering
Hope this helps!