Hands-On Reactive Programming in Spring 5
上QQ阅读APP看书,第一时间看更新

Unbounded queue

The first and most obvious solution is to provide a queue that is characterized by unlimited size, or simply an unbounded queue. In that case, all produced elements are stored inside the queue first and then drained by the actual subscriber. The following marble diagram depicts the mentioned interaction (Diagram 3.4):

Diagram 3.4. Example of Unbounded Queue

On the one hand, the central benefit that came with handling messages using an unbounded queue is the deliverability of messages, which means that the consumer is going to process all stored elements at some point in time. 

On the other hand, by succeeding in the deliverability of messages, the resiliency of the application decreases because there are no unbounded resources. For instance, the whole system may be easily crushed once the memory limit is reached.