Apama Capital Markets Foundation Documentation : Capital Markets Foundation : Market Data Management : Market data subscribers : Subscribing to market data : Subscription examples : Sample code using same session to subscribe to multiple data types
Sample code using same session to subscribe to multiple data types
The following code provides an example of using the same session to subscribe to multiple market data types.
using com.apama.session.SessionHandlerFactory;
using com.apama.session.SessionHandler;
using com.apama.md.TradeSubscriberFactory;
using com.apama.md.BBASubscriberFactory;
 
monitor SubscriberExample5 {
 
context mainContext := context.current();
 
action onload() {
SessionHandler sessionHandler :=
SessionHandlerFactory.connect(
mainContext, "MySession", "MyTransport");

TradeSubscriberFactory.create(
sessionHandler).subscribe("SOW");

BBASubscriberFactory.create(
sessionHandler).subscribe("SOW");
}
}
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback