“Nirvana Data Groups” – Managing Subscriptions on Behalf of Clients in an SDP – Part 2
As Single Dealer Platform’s (SDP) have become more focused on delivering custom flows of data to their clients, the ability to support fluid subscriptions efficiently has become very important . At my-Channels the response to this has been the addition of a new delivery paradigm : “Nirvana Data Groups” which they released late last year.
Like the technology described in the previous article, Nirvana Data Groups enable the out of band server based management of subscriptions. These subscriptions can be spread across enterprise, web and mobile clients.
Data Groups remove the need for clients to subscribe to and then potentially resubscribe to streams as and when market conditions dictate or margin groups change etc. Some of the obvious benefits include:
- The simplification of the conversation that takes place between client and server
- The removal of the need for resource specific ACLs within the system
- Lower overall application latencies
The workflow for Nirvana Data Groups is not too dissimilar to the previous article in that:
- Business server application (more recently built using CEP technology) that connects to Nirvana with appropriate credentials and monitors the systems default Data Group
- Client Application connects to Nirvana with appropriate credentials. Nirvana automatically adds client connection to the default Data Group
- Business server is notified of client connection, adds client to appropriate Data Groups based on entitlements
- Client Application begins consuming data
Client connections can be added and removed from any number of Data Groups dynamically by the Business server application without the need for the client to interact with the server. The Business server application can create Data Groups on the fly, permission them accordingly and define relationships between different Data Groups.
Point 1 above would do something like this:
// Defines operations for management of groups and streams
public interface IDataGroupManager
{
void Connect(string url, string username);
nDataGroup CreateDataGroup(string group);
bool DeleteDataGroup(string group);
void AddStreamToGroup(nDataGroup group, nDataStream stream);
}
// Server / Group Manager code
public class GroupManager : IDataGroupManager, nDataGroupListener, nDataStreamListener
{
private nSession Session;
private nSessionAttributes Attributes;
private nDataGroup DefaultGroup;
private string myuser;
public nDataGroup CreateDataGroup(string name)
{
return Session.createDataGroup(name);
}
public void DeleteDataGroup(string name)
{
Session.deleteDataGroup(name);
}
public void AddStreamToGroup(nDataGroup group, nDataStream stream)
{
group.add(stream);
}
// Connecting the Data Group Manager
public void Connect(string url, string username)
{
myuser = username;
// setup the GroupManager connection to the Nirvana Server
Attributes = new nSessionAttributes(url);
Session = nSessionFactory.create(Attributes, username);
// Initialise with the Data Stream Listener
Session.init(this);
// Get the default Data Group and add a listener to get callbacks for connecting users to the default data group
DefaultGroup = Session.getDefaultDataGroup(this);
}
Point 2 would look a little like the following code:
public class Client : nDataStreamListener
{
private nSession Session;
private nSessionAttributes Attributes;
private string myuser;
public void Connect(string url, string username)
{
myuser = username;
// setup the GroupManager connection to the Nirvana Server
Attributes = new nSessionAttributes(url);
Session = nSessionFactory.create(Attributes, username);
// Initialise with the Data Stream Listener
Session.init(this);
}
}
Point 3,this is where we map incoming client connections to Data Groups. The code might look like this:
// Callback received when Users connect (initialise a Nirvana session with a Data Stream Listener
public void addedStream(nDataGroup group, nDataStream stream, int count)
{
if (!stream.Subject.Contains(myuser))
{
// we have got a connection from another stream user
// now we need to work out what groups to add this user to,
// for the purposes of this example, lets assume this is performed by some entitlements service
string[] groups = IGroupEntitlements.getEntitledGroups(stream.Subject);
foreach (string sgroup in groups)
{
nDataGroup group = IDataGroupManager. CreateDataGroup(sgroup);
IDataGroupManager. AddStreamToGroup(group, stream);
}
}
}
Point 4. This code demonstrates how data is consumed by the client connection
// Callback for consuming events
public void onMessage(nConsumeEvent evt) {
// events consumed via the nDataStreamListener callback
}

[...] This post was mentioned on Twitter by paulcbrant, Bala Subra. Bala Subra said: #Lab49 : “Nirvana Data Groups” – Managing Subscriptions on Behalf of Clients in an SDP – Part 2: As Single Deale… http://bit.ly/fSHdd4 [...]
Tweets that mention “Nirvana Data Groups” – Managing Subscriptions on Behalf of Clients in an SDP – Part 2 « Tales from a Trading Desk -- Topsy.com said this on January 26, 2011 at 10:51 am |
[...] feature called DataGroups, and feedback received to date has been very encouraging. Thank you to Matt Davey and Olivier DeHeurles, both of whom have written excellent blogs on their thoughts about [...]