5

We are using RedisPubSubReactiveCommands and calling the subscribe and observeChannels methods of Lettuce.

In case of a fast publisher and a slow subscriber, how is the back pressure handled? Since publishers and subscribers are independent in Redis, there's no way the producer can be slowed down. Given this fact, which of the following understandings is correct?

  1. Does the data get dropped at application side (lettuce drops it) depending on the OverflowStrategy taken by observeChannels ? If this is the scenario, its quite inefficient, since the data is coming all the way from Redis server till the application, creating unnecessary network traffic.

  2. Does Lettuce convey back pressure to TCP layer of client side, then Application doesn’t receive anything, but TCP buffers will be full. Looking at this Github commit, this seems to be the implementation. But what I don't understand is, what is done with the OverflowStrategy provided?

  3. Does the back pressure get conveyed all the way to the Redis server, so that network traffic is reduced. This is the most efficient solution in my opinion. I don’t think this is the behaviour of Redis/Lettuce. What could be the reason to not have it this way?

Could any one please help us in forming a correct understanding.

Dollyg
  • 317
  • 2
  • 7

0 Answers0