Digitec D3 Streaming Interface Adapter

Introduction

The Spotfire Streaming Adapter for Digitec D3 Streaming Interface allows a StreamBase application to retrieve market data from the Digitec D3 Pricing Engine.

The adapter has a single input port for submitting subscribe and unsubscribe requests, and four output ports for status, market updates, errors, and exceptions.

Adapter Properties

All adapter properties except the global ID are entered in the market data adapter's Properties view.

Property Description
Digitec D3 Server Name The name or IP address of the system running the Digitec D3 Pricing engine.
Digitec D3 Server Port The port number the D3 pricing engine is listening on.
Warn if Field Absent If enabled, the adapter emits a warning message if a field specified in the adapter's output schema is not present in the Digitec Update message.
Reconnect Interval The number of seconds to wait before attempting a reconnection.
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.

Using the Adapter in a StreamBase Application

The adapter's icon on the EventFlow canvas has a specific set of input and output ports to communicate with the surrounding application. As with other Spotfire Streaming adapters and operators, you can optionally enable an Error Output Port, as described in Using Error Ports and Error Streams.

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 Adapter drawer of the Palette view, drag a Digitec D3 Streaming adapter component to the canvas.

  3. Select the Digitec D3 Streaming icon on the canvas and select the Adapter Properties tab in the Properties view. Provide the required parameters to connect to your site's D3 Pricing Engine.

  4. Select the Edit Schemas tab in the Properties view. Enter the Digitec D3 Update Message fields you wish to use. The Digitec D3 sample has two different named schemas you can use.

  5. Connect an Input Stream to the adapter's input port. This stream must have the field names defined above.

  6. Connect Output Streams to the adapter's output ports.

Adapter Ports

The Digitec D3 input adapter retrieves market data from the Digitec server. It has one input port and four output ports:

  • Subscriptions (input): This port is used to make subscribe and unsubscribe requests, and has the following schema:

    • Command, string: The type of request being made:

      • subscribe—subscribe to market data for a specified symbol using the specified subscriptionID.

      • unsubscribe—unsubscribe from the specified subscriptionID.

    • subscriptionID, string: A string that is unique for the life of the connection with the D3 Pricing Engine.

    • symbol, string: A string defined as <CCY1><CCY2><POINT>[-<POINT>], where:

      <CCY1> := ISO-Code of first currency (that is, the currency whose price is requested)

      <CCY2> := ISO-Code of second currency (that is, the currency in which the price is expressed)

      <POINT> := <TENOR>|<DATE>

      <TENOR> := ON|TN|SP|SN|...|xW|xM (where x is an integer and W and M stands for months and weeks respectively)

      <DATE> := YYYYMMDD

      Examples:

      EURCHF3M
      GBPUSD20061127
      GBPUSD20061120-20061203
      GBPUSD1M-20070113

  • Output port 1, StatusOut:

    This output port emits status, information, and error tuples and has the following schema:

    • Type, string: Contains one of the following values describing the type of event that occurred:

      • CONNECTION

      • SUBSCRIPTION

      • ERROR

    • Object, string: the name of the item associated with the event:

      • The name of the adapter icon on the canvas

    • Action, string: Contains one of the following values describing the action that took place:

      • CONNECTED

      • DISCONNECTED

      • INITIALIZING

      • UNAVAILABLE

      • SUBSCRIBED

      • UNSUBSCRIBED

    • Message, string: A human-readable description of the event.

    • time, timestamp: The time the event occurred.

  • Output port 2, Updates

    The adapter emits tuples on this port when Update messages are received from the D3 Pricing Engine for subscribed symbols. You define the schema of this port in the Edit Schema tab of the adapter's Properties view. The Digitec D3 Streaming Interface Sample has two named schemas you can use as examples. One is a simple output schema and the other is a more complete one.

    The names of the fields used in the Edit Schema tab are simply the names of the fields that will be extracted from the D3 Pricing Engine Update message.

  • Output port 3, Errors

    The market data adapter emits tuples on this port when Error messages are received from the D3 Pricing Engine. It has the following schema:

    • SubscriptionId, string: The unique ID for the subscription that resulted in the quote.

    • ErrorCode, int: The D3 Pricing Engine internal error code.

    • ErrorText, string: A human readable string supplied by the D3 Pricing Engine.

    • time, timestamp: The time the Error message was received by the Spotfire Streaming adapter.

  • Output port 3, Exceptions

    The adapter emits tuples on this port when Exception messages are received from the D3 Pricing Engine. It has the following schema:

    • ExceptionText, string: The exception text string supplied by the D3 Pricing Engine.

    • time, timestamp: The time the Exception message was received by the Spotfire Streaming adapter.

Typechecking and Error Handling

The Digitec D3 Streaming adapter uses typecheck messages to help you configure the adapter in your StreamBase application. In particular, the adapter generates typecheck messages for the following reasons:

  • One or more required fields in an input schema are missing or of the wrong type.

  • One or more unexpected fields are present in an input schema.

The adapter emits status tuples and warning messages during runtime under various conditions, including:

  • When the adapter is initializing.

  • The adapter fails to connect or loses its connection to the D3 Pricing Engine.

  • The adapter incurs an error emitting a tuple.

  • If the Warn if Fields Absent property is true and a field in the output schema is not found in the D3 Streaming Update message.

Suspend/Resume Behavior

When suspended, the adapter continues to receive and process Digitec D3 Streaming messages, but no longer emits tuples on its output ports. This effectively drops market data for the duration the adapter is suspended.

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

Related Topics