com.apama.marketdata
Monitor MarketDataGateway


The market data gateway service is used to ensure safety in the firewall.

It is there to ensure that the firewall rules have processed the market data before the algorithms receive it. That way, when the algorithm sends new orders, the latest risk data will be avaiable.

The way that the gateway works is by changing the service id on the market data events. The application code must send their subscribe and unsubscribe requests using the external service id. The actual service id that the adapter uses is specified in an extra parameter. The gateway service will then forwards those events on with the service id changed to the internal one. All the risk analytics process this. The gateway also routes an end of transaction event after the market data event. When this chaser token is received by the gateway, it knows that the subscription has been processed by all the risk analytics, and forwards it on to the adapter.

More importantly, the gateway also works in the reverse direction. The market data from the adapters is received by the gateway, and forwarded on using the internal service id. This updates the risk analytics. Again an end of transaction event is sent as a chaser. When the gateway receives the chaser it knows the risk analytics have processed the depth. It then forwards on the depth using the external service id, which should be picked up by the application.
Since:
CMF 1.1.0
Version:
10.0
See Also:
com.apama.marketdata.Constants#SERVICE_NAME_EXTERNAL - The service id that the application should use
com.apama.marketdata.Constants#SERVICE_NAME_INTERNAL - The service id that the risk analytics should use
com.apama.marketdata.Constants#TARGET_SERVICE_EXTRA_PARAM - The extra parameter used to specify the target adapter service
com.apama.oms.transaction.EndOfInfrastructureTransaction - The event used to mark the end of a firewall transaction i.e. the processing of any one event from the adapter or application.
com.apama.oms.transaction.StartOfInfrastructureTransaction - The event used to mark the beginning of a firewall transaction (i.e. the processing of any one event from the adapter or application).
Routes:
com.apama.marketdata.Depth - This service routes the events using the internal service id, for the analytics to use, and the external service id, for the application to process.
com.apama.marketdata.SubscribeDepth - This service routes the events using the internal service id, for the analytics to use, and to the adapter to actually do the subscription
com.apama.marketdata.SubscribeTick - This service routes the events using the internal service id, for the analytics to use, and to the adapter to actually do the subscription
com.apama.marketdata.Tick - This service routes the events using the internal service id, for the analytics to use, and the external service id, for the application to process.
com.apama.marketdata.UnsubscribeDepth - This service routes the events using the internal service id, for the analytics to use, and to the adapter to actually do the unsubscription
com.apama.marketdata.UnsubscribeTick - This service routes the events using the internal service id, for the analytics to use, and to the adapter to actually do the unsubscription
Listens:
com.apama.marketdata.Depth - This service listens for events using the adapter and internal service ids, forwarding on the events to the next stage, eventually the application (using the external service id).
com.apama.oms.transaction.StartOfInfrastructureTransaction - The start of transaction event is used to trigger the forwarding of the data with the internal service id.
com.apama.marketdata.SubscribeDepth - This service listens for events using the internal and external service ids, forwarding on the events to the next stage, eventually the adapter.
com.apama.marketdata.SubscribeTick - This service listens for events using the internal and external service ids, forwarding on the events to the next stage, eventually the adapter.
com.apama.marketdata.Tick - This service listens for events using the adapter and internal service ids, forwarding on the events to the next stage, eventually the application (using the external service id).
com.apama.marketdata.UnsubscribeDepth - This service listens for events using the internal and external service ids, forwarding on the events to the next stage, eventually the adapter.
com.apama.marketdata.UnsubscribeTick - This service listens for events using the internal and external service ids, forwarding on the events to the next stage, eventually the adapter.