Universal Messaging 9.7 | Universal Messaging Developer Guide | Enterprise APIs | Enterprise Developer's Guide for C# | Publish / Subscribe using Datastreams and Datagroups | Publishing to Datagroups | Priority Messaging
 
Priority Messaging
In certain scenarios it may be desirable to deliver messages with differing levels of priority over the same datagroup. Universal Messaging provides the ability to expedite messages based on a priority level. Messages with higher levels of priority are able to be delivered to clients ahead of lower priority messages.
Universal Messaging achieves this capability through a highly concurrent and scalable implementation of a priority queue. Where in a typical queue events are first in first out, in a priority queue the message with the highest priority is the first element to be removed from the queue. In Universal Messaging each client has its own priority queue for message delivery.
The following code snippet demonstrates how to set priority on a message:

nConsumeEvent evt;
...
evt.getAttributes().setPriority(9);
Priority Messaging allows for a high priority message to be delivered ahead of a backlog of lower priority messages. Ordering of delivery is done dynamically on a per client basis.
Priority messaging is enabled by default, there are no configuration options for this feature.
As Priority Messaging is done dynamically events may not appear in strict order of priority. Higher priority events are expedited on a best effort basis and the effects become more noticeable as load increases.
It is possible to specify multiple levels of priority for events on the same datagroup. This behaviour will cause the events to be delivered highest priority first. When doing this it is important to realise that events on a datagroup will no longer be delivered on a first in first out basis.

Copyright © 2013-2015 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.