This is archived documentation for an older version of Nirvana (v3.1). Please refer to documentation for the latest version if required.

What are event dictionaries used for?

Event dictionaries provide the ability to store event meta data. They allow you to describe any number of message properties of an event such as its message type, source etc. Event dictionaries enable this metadata to be used without the whole message envelope to be opened.

An example of that would be a message selector where the Nirvana Realm Server can use it to create a filter that is based on metadata, so it is not necessary to open the whole message in order to see if it should be filtered or not.

Event dictionaries are implemented in Nirvana using the nEventProperties class. They are quite similar to a Hashtable except that primitive types can be added. The nConsumeEvent event object can be constructed using an nEventProperties object.

So if for example you were to publish an event containing the definition of a bond with a bondname of bond1 and you wanted to have a dictionary entry called BONDNAME specifying that you would do:

 

nEventProperteis props =new nEventProperties();

props.put(“BONDNAME”,”bond1”);

nConsumeEvent e=new nConsumeEvent(props,myBondDefinition.getBytes());

myChannel.publish(e);

For further use on the use of event dictionaris please see the FAQs for channel keys and filtering.