Nirvana JavaScript : Event Dictionaries

Event Dictionaries (nEventProperties) provide an accessible and flexible way to store any number of message properties for delivery within a Nirvana Event.

Event Dictionaries are quite similar to a hash table, supporting primitive types, arrays, and nested dictionaries.

Nirvana filtering allows subscribers to receive only specific subsets of a channel's events by applying the server's advanced filtering capabilities to the contents of each event's dictionary.

In this code snippet, we assume we want to publish an event containing the definition of a bond, say, with a name of "bond1":

var event = new nConsumeEvent();
var dictionary = new nEventProperties();
dictionary.put("bondname", "bond1");
dictionary.put("price", 100.00);
event.setDictionary(dictionary);
channel.publish(evt);

Note that in this example code, we also create a new Nirvana Event object (nConsumeEvent) to make use of our Event Dictionary (nEventProperties).