Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This document contains a description of the main features of REST Transport Adaptor for FixEdge and common steps required to install the of FIXEdge's REST Transport Adaptor (REST TA) for the FIX Edge, as well as common steps required for installation.

Concept

FIXEdge REST adaptor is a REST server that handles REST requests with incoming messages in JSON form, converts them to FIX format and sends them to the a given target. The adapter is designed for the generic processing of messages, without lock-in to the specific message typetypes.

Depending on the configuration settings, the adaptor can transform incoming message to either a FIX XML message of 'n' type, or map JSON fields into FIX tags. The type of the resulting message should be defined in tag 35.

The JSON message format of message might look like as follows:

Code Block
languageyml
'{"35":"D", "1":"12345", "56":"CITIGROUP", ..........}'

...

Requests are sent as HTTP POST requests to the following URL: http://<Address>:<ListenPort>/messages

...

Resulting FIX messages can be optionally validated against FIX dictionaries defined in the engine.properties configuration file.

As a result of a REST request, the adapter should return one of the following HTTP status codecodes:

  • 200 - Success
  • 202 - Accepted, returned when a message is successfully received and parsed, but couldn't be delivered to the client in FE
  • 400 - HTTP error Bad Request (with JSON content including error message), in case of wrong input message or validation errors
  • 404 - HTTP error Not found for requests with the wrong URL  

...

FIXEdge REST adaptor can be configured to write into write the following data into separate log file the following data:

  • Content of input request
  • Resulting FIX messages
  • HTTP status returned to the caller

Integration with FIXICC

The adaptor supports the monitoring of its current state with FIXICC. It provides the following monitorable properties:

...

  • Fields in input JSON message are listed as pairs of "FIXID":"FIXValue".
  • a JSON message can contain repeating groups represented as follows:

    Code Block
    { "NoRecordsID": [      { "FIXID":"FIXValue", "FIXID":"FIXValue"... },      { "FIXID":"FIXValue", "FIXID":"FIXValue"... }     ...    ] }

...

REST Acceptor TA can be configured to validate converted FIX messages. FIX Message validation uses the following default validation options:

...

 In order to set up REST TA for FIX Edge you need to:

1. Copy the FIXEdge distribution package to the FIX Edge home:

...

Code Block
languagetext
TransportLayer.TransportAdapters = TransportLayer.SmtpTA, TransportLayer.RestTA

3. Configure the TA.

3.1.  Add the REST TA section to the FIXEdge.properties.

...

The REST TA Client can be referred to the business layer (BL) by ClientID by the ClientID name specified in the FIXEdge.properties file. Below is an example of BL_Config.xml.

...

Property NameDescriptionRequiredDefault Value 

Transport adapter parameters

TransportLayer.RestTA.Description

User-defined description of the Transport Adapter

Y

REST Acceptor TA

TransportLayer.RestTA.DllName

TA library file name

Y

  

TransportLayer.RestTA.Type

TA library type

Y

DLL

TransportLayer.RestTA.ClientID 

Transport adaptor Client ID which identifies the source of messages in BL config

Y


TransportLayer.RestTA.ListenPort

TCP port number for incoming HTTP connections. Allowed range is 1 - 65535

N

8001

TransportLayer.RestTA.FIXVersion

FIX version of generated messages:

  • FIX40 - FIX 4.0
  • FIX41 - FIX 4.1
  • FIX42 - FIX 4.2
  • FIX43 - FIX 4.3
  • FIX44 - FIX 4.4
  • FIX50 - FIX 5.0
  • FIX50SP1 - FIX 5.0 SP1
  • FIX50SP2 - FIX 5.0 SP2 

N

 

FIX44

 

TransportLayer.RestTA.ConversionMethod

The method used to convert input messages into FIX format:

  • WrapInXmlMessage - put the input data into FIX XML message of 'n' type
  • NumericTagValueMapping - parse the input JSON file format to corresponding FIX message
  • Raw- raw FIX message (FIX message is sent to BL as is)

    Info

    Introduced in FIXEdge 6.9.0

N

 

NumericTagValueMapping

 

TransportLayer.RestTA.ValidateFIXMessage

Enables/disables validation of resulting FIX message:

  • No – validation disabled
  • ValidateAndWarn – validation enabled, a warning message is added to the log when validation fails
  • ValidateAndReject – validation enabled, service returns HHTP error 400 (bad request) and rejects the message if validation fails 

N

No

HTTP(S) Server Parameters

TransportLayer.RestTA.Protocol

Security type of connection. Allows user to setup secure or non-secure http connection. 
Info

Introduced in FIXEdge 6.9.0

  • HTTP - non-secure connections 

  • HTTPS - secure connections 

Yes 

TransportLayer.RestTA.HTTP.timeout

Connection timeout for HTTP connections in seconds.

 

N

 

60

 

TransportLayer.RestTA.HTTP.keepAlive 

Enables/disables persistent HTTP connections:

  • false – persistent HTTP connections are disabled
  • true – persistent HTTP connections are enabled 

N

true

 

TransportLayer.RestTA.HTTP.maxKeepAliveRequests

Specifies the maximum number of requests allowed during a persistent connection. 0 means unlimited connections.

N

0

 

TransportLayer.RestTA.HTTP.keepAliveTimeout

Connection timeout for persistent HTTP connections in seconds. 

N

10

TransportLayer.RestTA.HTTP.maxThreads

A maximum number of threads processing HTTP requests. The allowed range is 1 – 16. 

N

1

TransportLayer.RestTA.HTTPS.PrivateKey

Path to a private key

Info

Introduced in FIXEdge 6.9.0

Conditional. 
Required with secure connections:
TransportLayer.RestTA.Protocol = HTTPS

 FIXEdge1/conf/AdminRESTAPI.key

TransportLayer.RestTA.HTTPS.Certificate 

Path to certificate 

Info

Introduced in FIXEdge 6.9.0


Conditional. 
Required with secure connections:
TransportLayer.RestTA.Protocol = HTTPS

 FIXEdge1/conf/AdminRESTAPI.key

TransportLayer.RestTA.HTTPS.PrivateKeyPassword

Private key passwordConditional
Used when the private key is password-encrypted.

TransportLayer.RestTA.AuthHeader

Authentication header (may be used in HTTP mode also)

Info

Introduced in FIXEdge 6.9.0

No

TransportLayer.RestTA.AuthValue

Authentication value (may be used in HTTP mode also)

Info

Introduced in FIXEdge 6.9.0

No

Logging Parameters

TransportLayer.RestTA.LogCategory

Transport adaptor log category

Y


 Log.RESTTA.Device

The target device for logging the received and sent messages:

  • File – writes a log to a separate file
  • Console – sends a log to console window 

N

 

 Log.RESTTA.File.Name

 Filename used to log the received and sent messages

N

 

Configuration example

The An example of REST Acceptor configuration with the security mode turned on:

Code Block
TransportLayer.RestTA.Description = RESTAcceptorTA
TransportLayer.RestTA.DllName = bin/REST_Acceptor_TA-vc10-MDD-x64.dll
TransportLayer.RestTA.Type = DLL
TransportLayer.RestTA.ClientID = RestAcceptorClient
TransportLayer.RestTA.LogCategory = RestAcceptorClient
TransportLayer.RestTA.Protocol = HTTPS
TransportLayer.RestTA.HTTPS.PrivateKey = FIXEdge1/conf/AdminRESTAPI.key
TransportLayer.RestTA.HTTPS.Certificate = FIXEdge1/conf/AdminRESTAPI.crt
TransportLayer.RestTA.ListenPort = 8001
TransportLayer.RestTA.FIXVersion = FIX44
TransportLayer.RestTA.ConversionMethod = NumericTagValueMapping
TransportLayer.RestTA.ValidateFIXMessage = ValidateAndWarn
TransportLayer.RestTA.AuthHeader = apikey
TransportLayer.RestTA.AuthValue = QWERTY0123456789
TransportLayer.RestTA.PrivateKeyPassword = PKEYPASS123