Home    
 
Products Solutions Developers Nirvana Nirvana documentation Nirvana examples Nirvana FAQ Nirvana Archive Matrix Partners Download Company Contact
 
 

What are event dictionaries used for?

home > developers > nirvana

Event dictionaries provide the ability to store data attributes in a easily accessible way. They allow you to describe any number of message properties in a flexible way.

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. as

Dictionaries can contain nested dictionaries and arrays of dictionaries. Nirvana filtering allows subscribers to filter based on the contents of these inner sets of properties using our advanced filtering capabilities.

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);

OR

nEventProperteis props =new nEventProperties();
props.put(“BONDNAME”,”bond2”);
nConsumeEvent e=new nConsumeEvent(props,myBondDefinition.getBytes());
myQueue.push(e);

For further information on the use of event dictionaries please see the filtering documentation. Specific for channels, please see more info on how to create channel keys.

 

 
   
© 2001-2008 my-channels.com. (Terms of Use)