Using JMS message priorities with BusinessWorks and BusinessWorks Container Edition

Emmanuel Marchiset
2 min readSep 18, 2022

While not well known, because it was not managed in early releases, TIBCO EMS can manage JMS message priorities.

Using message priorities is useful in some use cases for example when processing files you may want to process small files with a priority over large files or in some other cases you may want to process messages coming from a specific source with a lower priority (for example to limit impacts from a batch over the processing of real time events).

Priority is a message attribute, which values varies from 1 to 9 with 9 being the highest priority (the default priority is 4).

Message priorities are managed per queue and enforced only when there are pending messages in a queue, in such case messages are delivered to the Consumer applications by order of priority. For a given priority, messages are delivered in the order they were published as usual.

Note that JMS message priorities are not managed in BusinessWorks, once delivered by the EMS server all messages are processed equally in BusinessWorks.

Setting a message priority in BusinessWorks

Setting JMS priority for a message

In BusinessWorks Message priority can be set in the JMS Send activity either using the ‘Priority’ field of the ‘Advanced’ tab of the activity (not very useful because messages would all have the same priority) or by mapping the ‘JMSPriority’ field in the ‘Input’ tab of the activity (which allows to define priorities on a per message basis).

Example

Let’s consider we have the following pending messages in queue Q1 :

Message M1 Priority 4
Message M2 Priority 9
Message M3 Priority 9
Message M4 Priority 1
Message M5 Priority 4
Message M6 Priority 9
Message M7 Priority 4
Message M8 Priority 7
Message M9 Priority 4
Message M10 Priority 7

If BusinessWorks is configured to process messages one by one (JMS Receive Message activity configured with Client Ack + Max Session = 1 to ensure message are processed one by one) messages will be delivered and processed in the following order:

Message M2 Priority 9
Message M3 Priority 9
Message M6 Priority 9
Message M8 Priority 7
Message M10 Priority 7
Message M1 Priority 4
Message M5 Priority 4
Message M7 Priority 4
Message M9 Priority 4
Message M4 Priority 1

BusinessWorks Consumer application output

Reference elements

TIBCO EMS documentation on message priorities:

https://docs.tibco.com/pub/ems/10.1.0/doc/html/GUID-D8D549CC-7516-4E9C-99FD-F38595400F75.html

Note

The same approach can be used in a BusinessWorks 5.X context.

--

--

Emmanuel Marchiset

I work as an Architect at TIBCO Software on Integration products. Opinions here are my own.