Class ExsimFeedModule

    • Field Detail

      • sessionId

        private quickfix.SessionID sessionId
        session ID value that the module will use to connect
      • socketInitiator

        private quickfix.SocketInitiator socketInitiator
        handles physical connection to the simulated exchange
      • messageFactory

        private FIXMessageFactory messageFactory
        message factory for the specified FIX version
      • exsimFeedConfig

        @Autowired
        private ExsimFeedConfig exsimFeedConfig
        configuration used to connect to the exchange
      • symbolResolverService

        @Autowired
        private SymbolResolverService symbolResolverService
        resolves symbols to instruments
      • marketDataService

        @Autowired
        private MarketDataService marketDataService
        provides access to market data services
      • feedAvailableTimeout

        private long feedAvailableTimeout
        number of milliseconds to wait for the feed to become available if a request is made while it is offline
      • feedStatus

        private volatile FeedStatus feedStatus
        current status of the feed
      • idCounter

        private final AtomicLong idCounter
        used to assign unique event ids
      • supportedAssetClasses

        private static final Set<AssetClass> supportedAssetClasses
        supported asset classes for this provider
      • supportedCapabilities

        private static final Set<Capability> supportedCapabilities
        supported capabilities for this provider
    • Constructor Detail

      • ExsimFeedModule

        protected ExsimFeedModule​(ModuleURN inInstanceUrn)
        Create a new ExsimFeedModule instance.
        Parameters:
        inInstanceUrn - a ModuleURN value
    • Method Detail

      • doFeedStatusRequest

        private void doFeedStatusRequest​(FeedStatusRequest inPayload,
                                         DataRequest inRequest,
                                         DataEmitterSupport inSupport)
        Execute a feed status request with the given attributes.
        Parameters:
        inPayload - a FeedStatusRequest value
        inRequest - a DataRequest value
        inSupport - a DataEmitterSupport value
      • doMarketDataRequest

        private void doMarketDataRequest​(MarketDataRequest inPayload,
                                         DataRequest inRequest,
                                         DataEmitterSupport inSupport)
                                  throws quickfix.FieldNotFound,
                                         quickfix.SessionNotFound
        Perform the market data request
        Parameters:
        inPayload - a MarketDataRequest value
        inRequest - a DataRequest value
        inSupport - a DataEmitterSupport value
        Throws:
        quickfix.FieldNotFound - if the request could not be built
        quickfix.SessionNotFound - if the message could not be sent
      • cancelMarketDataRequest

        private void cancelMarketDataRequest​(ExsimFeedModule.MarketDataRequestData inMarketDataRequestData)
                                      throws quickfix.FieldNotFound,
                                             quickfix.SessionNotFound
        Cancel the market data request with the given id.
        Parameters:
        inMarketDataRequestData - a String value
        Throws:
        quickfix.FieldNotFound - if the market data request cancel cannot be constructed
        quickfix.SessionNotFound - if the cancel message cannot be sent
      • updateFeedStatus

        private void updateFeedStatus​(FeedStatus inNewStatus)
        Update the feed status to the new given value.
        Parameters:
        inNewStatus - a FeedStatus value
      • getOrderBookFor

        private OrderBook getOrderBookFor​(Instrument inInstrument,
                                          String inRequestId,
                                          String inExchange)
        Get the order book for the given instrument.
        Parameters:
        inInstrument - an Instrument value
        inRequestId - a String value
        inExchange - a String value
        Returns:
        an OrderBook value
      • getEvents

        private List<Event> getEvents​(ExsimFeedModule.MessageWrapper inMessageWrapper,
                                      boolean inIsSnapshot)
                               throws quickfix.FieldNotFound
        Get the market data events from the given message.
        Parameters:
        inMessageWrapper - a MessageWrappervalue
        inIsSnapshot - a boolean vlue
        Returns:
        a List<Event> value containing the constructed events
        Throws:
        quickfix.FieldNotFound - if an expected field cannot be found
      • getAskIdFor

        private long getAskIdFor​(OrderBook inOrderbook,
                                 int inLevel)
        Get the message id used for the event at the given level of the ask book.
        Parameters:
        inOrderbook - an OrderBook value
        inLevel - an int value
        Returns:
        a long value
      • getBidIdFor

        private long getBidIdFor​(OrderBook inOrderbook,
                                 int inLevel)
        Get the message id used for the event at the given level of the bid book.
        Parameters:
        inOrderbook - an OrderBook value
        inLevel - an int value
        Returns:
        a long value
      • publishEvents

        private void publishEvents​(Deque<Event> inEvents,
                                   String inRequestId)
        Publish the given events to the data flow associated with the given id.
        Parameters:
        inEvents - a Deque<Event> value
        inRequestId - a String value