Morningstar Quotes Feed Input Adapter

Introduction

The TIBCO StreamBase® Adapter for Morningstar Quotes Feed allows a StreamBase application to receive market data from Morningstar servers. Both Interactive and broadcast feeds are supported. The types of data delivered depend on how the Morningstar adapter is configured, in combination with what services the Morningstar server has enabled for your account.

Properties

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

General Tab

Name: Use this required field to specify or change the name of this instance of this component, which must be unique in the current EventFlow module. The name must contain only alphabetic characters, numbers, and underscores, and no hyphens or other special characters. 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 check box 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 component's purpose and function. In the EventFlow Editor canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.

Adapter Properties Tab

This section describes the properties on the Adapter Properties tab in the Properties view for the Morningstar Quotes Feed adapter.

Property Description
Morningstar Server Name and Port Number A semicolon-separated list of Morningstar Quotes Feed servers in the form ServerName:PortNumber
Connect on startup Determines if a connection to the Morningstar server should be made as soon at the adapter starts.
User Name Your Morningstar account user name.
Password Your Morningstar account password.
Feed Type Select which type of Quotes Feed you wish to use. Must be either Interactive or Broadcast.
Field Dictionary Optionally supply a path to a customized dictionary file that maps field IDs to field names. See below for description of this dictionary.
Enable Admin Messages Select if you wish to receive Admin Messages. An output port is created for this message type.
Enable Trade Messages Select if you wish to receive Trade Messages. An output port is created for this message type.
Enable Quote Messages Select if you wish to receive Quote Messages. An output port is created for this message type.
Enable Recap Messages Select if you wish to receive Recap Messages. An output port is created for this message type.
Enable Close Messages Select if you wish to receive Close Messages. An output port is created for this message type.
Enable Static Messages Select if you wish to receive Static Messages. An output port is created for this message type.
Enable News Messages Select if you wish to receive News Messages. An output port is created for this message type.
Enable Chart Messages Select if you wish to receive Chart Messages. An output port is created for this message type.
Skip Missing Fields If selected, do not emit a warning for fields present in an incoming message with no corresponding StreamBase field. If not selected warning messages will only appear once for each missing field.
Log Level 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 is used. Available values, in increasing order of verbosity, are: OFF, ERROR, WARN, INFO, DEBUG, TRACE.

Advanced Properties Tab

This section describes the properties on the Adapter Properties tab in the Properties view for the Morningstar Quotes Feed adapter.

Property Description
Reconnect Interval When a connection fails, the number of seconds to wait before trying to reconnect.
Use Compression Request the Morningstar server to use data compression.
Receive Buffer Size The size in bytes of the buffer used to receive data, Set to 64K or better for optimal performance
Send Buffer Size The size in bytes of the buffer used to send data.

Edit Schemas Tab

Use the Edit Schemas tab to specify the schema for message types selected on the Adapters Properties tab. See Using the Adapter section below for information on field names to use.

For general instructions on using the Edit Schemas tab, see Defining Input Streams.

Cluster Aware Tab

Use the settings in this tab to allow this operator or adapter to start and stop based on conditions that occur at runtime in a cluster with more than one node. During initial development of the fragment that contains this operator or adapter, and for maximum compatibility with TIBCO Streaming 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.

Using the Adapter in a StreamBase Application

The StreamBase Morningstar Quotes Feed adapter can be configured to emit eight different data message types. The Morningstar account configuration determines which data message types, markets, and security types are available from the Morningstar server.

As with other StreamBase adapters and operators, you can optionally enable an Error Output Port, as described in Using Error Ports and Error Streams.

Morningstar Quotes Feed Data Messages

All Morningstar data messages are composed of a small header and a variable number of field ID-data type-value triplets. A Field Dictionary is used to map a Morningstar Field ID to a StreamBase field name.

A Morningstar data message header has four fields that are common across all data messages. These fields are:

  • SecurityType

  • ExchangeId

  • MarketCenter

  • Symbol

Unlike all other Morningstar fields, these field names are not configurable via the field dictionary.

For message types that are selected, Morningstar field IDs that appear in Morningstar messages and do not have a corresponding StreamBase field name defined cause a warning to be emitted by StreamBase Server. This warning can be disabled by selecting the Skip Missing Fields option.

Field names defined in a StreamBase message type schema that do not appear in a Morningstar message are set to null. Since individual Morningstar messages within a single message type can have a varying number of fields, it is not uncommon to have StreamBase tuples with a varying number of null fields.

Mapping Morningstar Field IDs to StreamBase Schema Fields

All Morningstar data messages are composed of a variable number of field ID-data type-value triplets. Morningstar field IDs are integer values. An optionally configurable field dictionary is used to map a Morningstar field ID integer to a StreamBase field name. A default field dictionary is included with the StreamBase adapter and is used if a custom dictionary is not specified. The default Morningstar field ID to StreamBase field name mapping can be seen in the file MSFieldDictionary.csv delivered as part of the Morningstar sample application.

Some field IDs are common across many message types, while other field IDs are unique to individual message types, security types, and so on. You must consult Morningstar documentation to determine the field IDs provided by various message types, and what fields are of particular interest.

An individual field ID always corresponds to a particular StreamBase field name. As Morningstar messages are parsed, their field IDs are looked up in the field ID dictionary to yield a StreamBase field name. The resulting StreamBase field name is used to set the field in the output tuple with the value parsed out of the Morningstar Field ID-value pair.

Morningstar value data types are represented by one of four StreamBase data types:

StreamBase Data Type Morningstar Data Type Morningstar Unsupported Data Type
String All Morningstar data types can be coerced into a string, a binary data type will be converted to a Hex value string. None
Integer

Long, *Unsigned Long, *Fractional Double, *Long Fractional Double, *Signed 64 bit Integer, *Unsigned 64 bit Integer, *Double, *Julian, *Snapper Time, Long Pointer To String, String

Note

Values denoted with * may incur data loss converting to an integer

Binary
Long

Long, Unsigned Long, Fractional Double, Long Fractional Double, Signed 64 bit Integer, Unsigned 64 bit Integer, Double, Julian, Snapper Time, Long Pointer To String, String

Binary
Double

Long, Unsigned Long, Fractional Double, Long Fractional Double, Signed 64 bit Integer, Unsigned 64 bit Integer, Double, Julian, Snapper Time, Long Pointer To String, String

Binary

Trying to set a Morningstar data type to an incompatible StreamBase data type results in a warning message at runtime.

Morningstar Quotes Feed Adapter Input Port

The Morningstar Quote Feed adapter has one command input port. The schema for this port has the following fields:

  • command (string). Specifies the command to send to the Quotes Server. The supported commands are:

    • Connect — Connect to the Morningstar servers. Only valid if currently disconnected.

    • Disconnect — Disconnect from the Morningstar servers. Only valid if currently connected.

    • SendCommand — only valid for the Interactive Feed type.

    • SetFlag

  • parameter (string). Any parameters needed by the command sent.

    • For the SendCommand command, this parameter can be any valid Quote Server command. For example:

      "MarketRequest /mkt=130 /ActReal"
      
    • For the SetFlag command, this parameter specifies the message or field to be enabled or disabled. For SetFlag, the parameter strings must be one of:

      Market
      News
      Message
      Security
      Field
  • Parameter for the SetFlag command, ignored for SendCommand (int). This parameter is the field ID that is to be set.

  • Parameter for the SetFlag command, ignored for SendCommand (int). This parameter is either 0 to disable or 1 to enable.

Morningstar Quotes Feed Adapter Output Ports

The StreamBase Morningstar Quotes Feed adapter has one output status port, plus a configurable number of data message ports.

The Morningstar Quotes Feed adapter has an optional Admin output port plus one or more data message output ports. The schema for these ports are defined in the Edit Schemas tab in the adapter's Properties view. The field names you specify must be present in the field dictionary currently being used.

The seven data message ports have four fields derived from the data header, and have fixed field names. These are: Symbol, SecurityType, ExchangeId, MarketCenter.

Status Output Port

The status output port will output tuples giving relevant information.

The schema for the status output port is:

Field Name Field Type Description
Status String A string describing the current status of the adapter.
Time timestamp The timestamp that the status occurred.
Info list(tuple) A list of name value pairs of data to give more context to the status.

The following is a list of status outputs and the associated objects:

Status Info Elements
Command Error
  • Error — The command error which will be one of

    • Command can not be null

    • Received request while disconnected

    • SetFlag command flag fields can not be null

    • Unknown command

    • Command/Flag parameter can not be null

    • SetFlag parameter not recognized

  • Tuple — The input command tuple in string format.

  • Command — The command string pulled from the tuple if available.

  • SubCommand — The sub command string pulled from the tuple if available.

Read Error
  • Error — The error message received while reading.

Send Error
  • Error — The error message received while sending.

Process Packet Error
  • Error — The error that occurred while processing the packet.

Connection Error
  • Error — The error message for the connection failure.

  • Host — The host the adapter has connected to.

  • Port — The port number of the host the adapter has connected to.

Close Connection Error
  • Error — The error message during close.

Connecting
  • Host — The host the adapter is attempting to connect to.

  • Port — The port number of the host the adapter is attempting to connect to.

Connected
  • Host — The host the adapter has connected to.

  • Port — The port number of the host the adapter has connected to.

Connection Closed No Values
Connection Retry
  • ReconnectInterval — The number of seconds which the adapter will wait between connection retries.

Command Reply Packet
  • OriginalPacketNum — The Original Packet Number.

  • ReplyCode — The reply code

  • Text — The reply text

Admin Packet
  • Type — The admin packet type.

Command Packet
  • Command — The command.

Function Packet
  • Code — The function code.

Keep Alive Packet
  • Response — The response timestamp.

Adding the Adapter to an EventFlow Application

Add an instance of the adapter to a new StreamBase EventFlow application as follows:

  1. In StreamBase Studio, create a project, including an empty StreamBase EventFlow Application file to host the adapter.

  2. From the Operators and Adapters drawer of the Palette view, drag the Output Adapter icon to the palette. This opens the Insert Output Adapter dialog.

  3. In the search field, type a string such as morning to narrow the list of adapters. When found, select the icon for the Morningstar Feed adapter, then click OK.

  4. Double-click the adapter icon and select the Adapter Properties tab in the Properties view. You must provide the Morningstar host name, port number, and your account name and password. You must also select which message types you are interested in.

  5. Select the Edit Schemas tab. For each message type selected, you must provide a schema for the output port. If you are using the default field dictionary, refer to sample file MSFieldDictionary.csv in the Morningstar sample for the list of acceptable field names.

Typechecking and Error Handling

The StreamBase Morningstar Quotes Feed adapter uses typecheck messages to help you configure the adapter.

The adapter generates warning messages at runtime under various conditions, including:

  • A field in the output port schema is not present in the field dictionary.

  • The data type of a Morningstar field can not be coerced into the corresponding StreamBase field data type.

Suspend and Resume Behavior

When suspended, the adapter continues to receive and process Morningstar messages, but no longer emits tuples on its primary output port.

When resumed, the adapter once again starts emitting tuples on its primary output port.

Related Topics