Jump to content
We have recently updated our Privacy Statement, available here ×
  • BW6.X - BWCE - Using JMS message priorities with BusinessWorks and BusinessWorks Container Edition


    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

    1*rEuejTzn3KBlYulZ-FMfHg.png

    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

    1*r4qGwekf8lC1hvmlOaenxg.png

    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.

    Additional elements

    You can refer to the attached sample project.

    JMSPriorityDemo.zip


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...