官术网_书友最值得收藏!

Priority queue

There is often a need when messages with higher importance should be given priority in processing compared to general messages with lower priority. This pattern is important for applications that provide different service level agreements (SLA) to consumers, which provide services based on different plans and subscriptions.

Queues follow first-in, first-out patterns. Messages are processed in sequence. However, with the help of this pattern, it is possible to fast-track processing of certain messages due to their higher priority. There are multiple ways to implement it. If the queue provides the capability of assigning priority and based on priority re-order messages, then even a single queue is enough to implement this pattern.

However, if the queue does not have the capability to re-order messages, then separate queues can be created for different priorities and each queue can have separate consumers associated with it.

In fact, this pattern can reuse competing consumer patterns if needed to fast-track processing of messages from each queue using multiple consumers.

主站蜘蛛池模板: 阿尔山市| 灌阳县| 城口县| 阿坝县| 湾仔区| 阿瓦提县| 万年县| 新田县| 嘉祥县| 兴仁县| 水城县| 龙川县| 田东县| 荆门市| 宁乡县| 淮北市| 阜城县| 平泉县| 白山市| 福建省| 仪征市| 普陀区| 三台县| 绍兴县| 阿瓦提县| 西华县| 梧州市| 楚雄市| 武平县| 牟定县| 汽车| 巴林左旗| 漳州市| 长兴县| 道孚县| 萨迦县| 白山市| 綦江县| 左云县| 潍坊市| 马公市|