Universal Messaging Developer Guide : The Enterprise Client APIs : The Enterprise Developer Guide for C++ : Publish/Subscribe using DataStreams and DataGroups : Universal Messaging C++: DataStream Event Publishing
Universal Messaging C++: DataStream Event Publishing
You can get references to any nDataStream (user) from the nSession object if you call getDefaultDataGroup(). You can also access nDataStreams by implementing the nDataGroupListener interface. Please see DataGroup management DataGroup management for more information. This will deliver callbacks as users are connected/disconnected. There are various writeDataStream methods available. These methods also support batching of multiple events to a single group or batching of writes to multiple DataStreams.

nEventProperties* props = new nEventProperties();

//You can add other types in a dictionary object
props->put("key0string"+x, "1"+x);
props->put("key1int", (int) 1);
props->put("key2long", (long) -11);

nConsumeEvent* evt1 = new nConsumeEvent(props, buffer);

//Publish the event
mySession->writeDataStream(evt1, myDataStream)
Copyright © 2013-2014 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback