Home

 

Persistence and units of work

Subscriber and publisher registration messages should normally be sent as persistent messages (registrations themselves are always persistent, regardless of the persistence of the messages that caused them). Publication messages can be either persistent or non-persistent. Brokers maintain the persistence and priority of publications as set by the publisher.

When reading messages from stream queues, brokers always read persistent messages within a unit-of-work, so that they are not lost if the broker or system crashes. Non-persistent messages might or might not be read within a unit-of-work, depending on the options set in the queue manager configuration file, qm.ini (or equivalent). This is described in Broker configuration stanza.

Publication messages are treated so that publication to subscribers is once and once only for persistent messages. For non-persistent messages, delivery to subscribers is also once only unless SyncPointIfPersistent was specified in the queue manager configuration file and the broker or queue manager stops abruptly. In this case, the message might be lost for one or more subscribers. Regardless of its persistence, however, a Publish message is never sent more than once to a subscriber, for a given subscription (unless Request Update is used).

Publishers and subscribers can choose whether or not to use a unit-of-work when publishing or receiving messages. However, if the SequenceNumber technique described previously is used for maintaining ordering, both publisher and subscriber must retain sequencing information atomically with putting or getting a message if the application is to be re-startable.



 

Home