Redelivery Counting
The BrokerConnectionDescriptor.setAutomaticRedeliveryCount method and the BrokerConnectionDescriptor.setRedeliveryCountEnabled method enables the redelivery counting feature for a BrokerClient. When redelivery counting behavior is enabled, the Broker maintains a counter for each guaranteed event that it sends to the BrokerClient. By testing the value in the counter, your client can determine whether it has received an instance of a particular event before.
The redelivery feature can be used in manual or automatic mode. The mode you select determines whether the redelivery counter is incremented by the Broker or by your client. When you use automatic mode, the Broker updates the redelivery counter prior to sending a event to the client. When you enable manual mode, your client must explicitly increment the redelivery counter when it receives an event.
To check whether redelivery counting is enabled, you use the BrokerConnectionDescriptor.getAutomaticRedeliveryCount method and the BrokerConnectionDescriptor.getRedeliveryCountEnabled method.
Note:
A redelivery counter is maintained for guaranteed events only. Volatile events always has a redelivery count of -1. Additionally, if a client does not enable redelivery counting, all events that it receives will have a redelivery count of -1.
For more information about using the redelivery counting feature, see
Detecting Redelivered Events.