Skip to content
Art2link ESB v2.02 LTS HomeDocumentationBlogContact
Patterns/Advanced & future/Priority queue

Priority queue

Not all messages are equally urgent. A rush order or a critical alert should not sit behind a million routine records. A priority flag routes the urgent ones onto a faster, separate path so they are handled first.

Mark priority as a value promoted to a variable, then use ordinary content-based routing to send high-priority messages to a dedicated send port — lightly loaded, perhaps less throttled — while normal traffic flows through the bulk path. The urgent lane stays short because only a little goes down it.

mixed messages priority? high fast lane normal bulk lane delivered first destination destination

Separate lanes are simpler and more transparent than a single re-sorting queue, and they fit the bus model exactly — it is just routing on a flag. The only discipline is to keep the high-priority class genuinely small, or the fast lane becomes just another backlog.

In Art2link this is content-based routing on a priority flag. Promote Priority on the Order type; an expedited send port subscribes only to the urgent traffic while the normal port takes the rest:

EXPRESSIONexpedited send port
{{Message.MessageType}} == "Order" && {{Promoted.Order.Priority}} == "high"

High-priority orders travel their own faster path instead of queuing behind the bulk backlog. The normal port’s predicate excludes high so nothing is delivered twice.

Guard against priority inflation. If everything is urgent, nothing is. Define what qualifies as high priority narrowly, and review it — the pattern only works while the urgent lane stays light.