WiserSolutions/quadro

Implement load feedback mechanism

igorshapiro opened this issue · 0 comments

Allow providing feedback to the message puller on the load of the service. Example:

Suppose we have 3 types of messages (A, B, C) with the following resources required to process the messages:

  • message A requires 4Gb RAM
  • message B requires 1Gb RAM
  • message C requires 10Mb RAM

Currently the puller will try to handle up to concurrency messages simultaneously, but if we have a 32Gb RAM machine and already handling 8 messages of type A - we just don't have capacity for any other message.

Instead of replying to all the events with OutOfCapacityError - it'd be better if the puller will hold the messages until the capacity is available.