Dead Event Store in Universal Messaging

What is Dead Event Store:

A Dead Event store is a channel/queue which can be configured for another channel/queue. The main use of DES is to keep the events that are removed by the realm server for later processing if required. UM Realm server remove the events automatically from channel/queue and move them to configured Dead Event Store – When,

  • TTL of individual event expire (or)
  • Channel/Queue TTL expires (or)
  • Number of events exceeds the channel/queue capacity policy and
    and those events which are not yet consumed.

How to configure DES in UM:

Configure through EM:

Configure through Java API:

There are a couple of example classes (makeChannelWithDeadStore.java and makeQueueWithDeadStore.java) which can be found in UM installation java examples folder i.e. \UniversalMessaging\java\examples\com\pcbsys\nirvana\apps

A Sample code snippet to create channel with DES as queue:

 nChannelAttributes deadca = new nChannelAttributes(DLQ_NAME);
 nQueue deadEventStore = sess.createQueue(deadca);
      
 and then
      
 nChannelAttributes nca = new nChannelAttributes(TOPIC_NAME);
 nca.setDeadEventHandler(deadEventStore);
 sess.createChannel(nca);

Configure through runUMTool:

runUMTool.bat CreateJMSTopic -rname=nsp://localhost:9005 -channelname=ch2 -deadeventstore=ch1 -deadeventstoretype=c
    
Note: Make sure ch1 channel is already created on the UM.
  
runUMTool.bat CreateJMSQueue -rname=nsp://localhost:9005 -queuename=qu2 -deadeventstore=qu1
   
Note: Make sure qu1 queue is already created on the UM.

How DES works in UM:

When there are no consumers for a Channel/Queue (when JMS Engine used) - If we publish events to the channel/queue and those events will be automatically moved to DES by realm server.

And if there are consumers but the events are not yet consumed before events TTL expiry or channel/queue TTL expiry or the events exceeded the capacity of the channel/queue – Those events will be moved to DES.

If “Honour capacity” storage property is used to prevent further events being published to the channel/queue if the channel capacity has reached. In this case, the newly arriving events will be discarded until there is a free capacity on the channel/queue. If you have configured DES for the channel/queue – the discarded events will NOT be placed in the DES. Instead, They are simply ignored.

DES mechanism may not work as expected when the channel has durable subscriptions. And it varies for different

durable types i.e.

For Serial or Shared Durables subscriptions, If event filtering is not used then the DES mechanism works as expected, For all other Durable types (Named and Shared-queue) - the behavior will produce unpredictable results.

Events on a channel/queue are deleted by a client calling purge, In this case, no event will be moved to DES.

There is a feature in UM where we will be addressing the inconsistencies in Dead Event Store behavior. But the scope of the feature is not yet decided.