CME MDP3 Adapter

Introduction

The Spotfire Streaming Input Adapter for CME Market Data allows StreamBase to receive data from a CME Market Data Protocol (MDP3) connection.

Placing a CME MDP3 Adapter on the Canvas

The CME MDP3 adapter is a member of the Java Adapters group in the Palette view in StreamBase Studio. Select the adapter from the Insert an Operator or Adapter dialog, following these steps:

  1. Open the Insert an Operator or Adapter dialog with one of the following methods:

    1. Drag the Adapters, Java Operators token from the Operators and Adapters drawer of the Palette view to the canvas.

    2. Click on the canvas where you want to place the adapter, then invoke the keyboard shortcut A I.

    3. From the top-level menu, invoke Insert>Input Adapter.

  2. In the search field, enter CME to narrow the list of adapters.

  3. Select the CME MDP3 adapter and click OK.

Prerequisites

In order run, the adapter requires that the open-source Java Market Data Handler for CME Market Data (MDP 3.0) from EPAM Systems be installed on development and deployment machines that are expected to run StreamBase applications that call this adapter. You can obtain the Data Handler software from public.tibco.com.

Once you download the above zip file, extract its contents to a temporary location and Maven install the following JAR files to your Maven repository:

  • Install the b2bits-jmdp3-2.1.4-mbp-with-mbo/b2bits-jmdp3-2.1.4.jar file to the local Maven repository with a mvn command like the following:

    mvn install:install-file 
      -Dfile=b2bits-jmdp3-2.1.4-mbp-with-mbo/b2bits-jmdp3-2.1.4.jar 
      -DgroupId=com.epam.cme.mdp3
      -DartifactId=b2bits-jmdp3 -Dversion=2.1.4 -Dpackaging=jar
    
  • Install the b2bits-jmdp3-2.1.4-mbp-with-mbo/lib/b2bits-jmdp3-core-2.1.4.jar file to the local Maven repository with a mvn command like the following:

    mvn install:install-file 
      -Dfile=b2bits-jmdp3-2.1.4-mbp-with-mbo/lib/b2bits-jmdp3-core-2.1.4 
      -DgroupId=com.epam.cme.mdp3 
      -DartifactId=b2bits-jmdp3-core -Dversion=2.1.4 -Dpackaging=jar
    

How the Adapter Works

The adapter has two input streams, one for commands and the other for instrument subscriptions. The command stream currently takes the CONNECT and DISCONNECT command. The subscription stream is used to SUBSCRIBE or UNSUBSCRIBE to the specified instrument (specified by SecurityID and SecurityDesc) or to UNSUBSCRIBEALL (to remove all subscriptions). Note that subscriptions are not dynamic; any subscription changes do not fully take effect until the connection is cycled (DISCONNECT then CONNECT).

Adapter Properties

This section describes the properties you can set for the adapter, using the various tabs of the Properties view in StreamBase Studio.

In following section tables, the Property column shows each property name as found in the one or more adapter properties tabs of the Properties view for this adapter.

General Tab

Name: Use this required field to specify or change the name of this instance of this component. The name must be unique within the current EventFlow module. The name can contain alphanumeric characters, underscores, and escaped special characters. Special characters can be escaped as described in Identifier Naming Rules. The first character must be alphabetic or an underscore.

Adapter: A read-only field that shows the formal name of the adapter.

Class name: Shows the fully qualified class name that implements the functionality of this adapter. If you need to reference this class name elsewhere in your application, you can right-click this field and select Copy from the context menu to place the full class name in the system clipboard.

Start options: This field provides a link to the Cluster Aware tab, where you configure the conditions under which this adapter starts.

Enable Error Output Port: Select this checkbox to add an Error Port to this component. In the EventFlow canvas, the Error Port shows as a red output port, always the last port for the component. See Using Error Ports to learn about Error Ports.

Description: Optionally, enter text to briefly describe the purpose and function of the component. In the EventFlow Editor canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.

Adapter Properties

The MDP3 adapter has the following properties:

Properties Tab

Property Data Type Default Description
Channel Config File string N/A

REQUIRED. Must point to the MDP channel configuration file (typically named config.xml), as distributed by CME. See https://www.cmegroup.com/confluence/display/EPICSANDBOX/MDP+3.0+-+FTP+Site+Information

Message Templates File string N/A

REQUIRED. Must point to the MDP template file (typically named templates_FixBinary.xml), as distributed by CME. See https://www.cmegroup.com/confluence/display/EPICSANDBOX/MDP+3.0+-+FTP+Site+Information

Channel ID integer N/A REQUIRED. Number of the channel to which to connect (to connect to multiple channels, use separate instances of the adapter).
Market Data Type radio buttons Market By Order Whether to use Market By Price or Market By Order.
Subscribe To All Instruments check box unchecked (false) Whether to subscribe to all instruments available on the channel, or to subscribe to individual instruments via either a subscription file or the subscription input port, or both.
Subscription File string blank If Subscribe To All Instruments is unchecked, a CSV file containing the list of initial subscriptions may be specified. The format of this file is as follows:

# This is a comment
# SecurityID,SecurityDesc
123456,MyInstrument
654321,MyOtherInstrument

Connect At Startup check box unchecked (false) Whether to attempt to connect to the data feed when the application is launched.
Gap Threshold integer 0 Number of out-of-sequence messages beyond which a replay is issued (0 to use default value (5)).
Incremental Queue Size integer 0 Size of the message queue on incremental feeds (0 to use default (15000)).
Receive Buffer Size integer 0 Size of the receive buffer (0 to use default (4 * 1024 * 1024)).
Replay Threads integer 0 The number of replay threads to use when requesting a TCP gap fill replay. If 0 no TCP replay will be done and Full Snapshot replays will always be used.
Max TCP Attempts integer 0 If Replay Threads is greater than 0, this value indicates how many TCP replay attempts are made before switching to a full snapshot replay. (0 to use default (3)).
Network Interface Name (Feed A) string blank Name of the Network Interface Card to use to establish connections to the A feed (leave blank to use default).
Network Interface Name (Feed B) string blank Name of the Network Interface Card to use to establish connections to the B feed (leave blank to use default).
User Name string blank User name to use when logging on to the TCP Replay feed (leave blank to use default).
Password string blank Password to use when logging on to the TCP Replay feed (leave blank to use default).
Log Level drop-down list INFO Controls the level of verbosity the adapter uses to send notifications to the console. This setting can be higher than the containing application's log level. If set lower, the system log level will be used. Available values, in increasing order of verbosity, are: OFF, ERROR, WARN, INFO, DEBUG, TRACE.

Cluster Aware Tab

Use the settings in this tab to enable this operator or adapter for runtime start and stop conditions in a multi-node cluster. During initial development of the fragment that contains this operator or adapter, and for maximum compatibility with releases before 10.5.0, leave the Cluster start policy control in its default setting, Start with module.

Cluster awareness is an advanced topic that requires an understanding of StreamBase Runtime architecture features, including clusters, quorums, availability zones, and partitions. See Cluster Awareness Tab Settings on the Using Cluster Awareness page for instructions on configuring this tab.

Concurrency Tab

Use the Concurrency tab to specify parallel regions for this instance of this component, or multiplicity options, or both. The Concurrency tab settings are described in Concurrency Options, and dispatch styles are described in Dispatch Styles.

Caution

Concurrency settings are not suitable for every application, and using these settings requires a thorough analysis of your application. For details, see Execution Order and Concurrency, which includes important guidelines for using the concurrency options.

Input Ports

The adapter has two input ports—the command and subscription ports.

Use the command port to programmatically trigger a connection or disconnection.

Field Name Field Type Description
Command string The command to execute: Connect or Disconnect.

Use the subscription port to programmatically add or remove subscriptions of instruments on the channel.

Field Name Field Type Description
Command string The command to execute: Subscribe or Unsubscribe or UnsubscribeAll.
SecurityID string The ID number (SecurityID tag) of the instrument to which to subscribe or unsubscribe. Ignored for the UnsubscribeAll command.
SecurityDesc string The description (SecurityDesc tag) of the instrument to which to subscribe. Ignored for the Unsubscribe and UnsubscribeAll commands.

Output Ports

The adapter has several output ports:

  • Status: Emits tuples related to status events (successful operations, errors, etc)

  • Full Snapshot: Market Data Full Snapshot messages

  • Incremental Refresh: Market Data Incremental Refresh messages

  • RFQ: RequestForQuote messages

  • Security Status: SecurityStatus messages

  • Security Definition: SecurityDefinition messages

The schema for the Status port is described below, while the schema for the other ports simply contain every field in the received message. Null fields indicate that the corresponding field was not specified in the message. Repeating groups are represented as a list of tuples, where each tuple represents one group.

Status Output Port

The status port emits tuples that describe events of interest, such as errors or the result of running a command.

Field Name Field Type Description
status string Describes this event. Possible values can include Connected, Disconnected, Error, and others.
info list<string> Contains any additional information pertaining to this event.

Typechecking and Error Handling

Typechecking fails if the input schema does not contain all the required fields.

Suspend and Resume Behavior

Upon suspension, the adapter finishes processing any message in flight, outputs the result tuples, then pauses until operation is resumed. Any messages received while paused are dropped.

Upon resumption, the adapter continues processing new messages as they are received.

CME MDP3 Adapter Sample

The StreamBase installation includes a sample demonstrating the use of this adapter. To load the sample in StreamBase, select File>Import Samples and Community Content and type cme to narrow the possible choices. Select the entry called CME MDP3 Adapter.

Back to Top ^