Page tree

Versions Compared

Key

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

...

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

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

...

Example of REST request using curl for localhost and listen port 8001:

Code Block
curl -H "Content-Type: application/json" -X POST -d "{\"35\":\"D\",\"1\":\"USD\",\"386\":[{\"336\":\"ABCD\"}]}" http://localhost:8001/messages


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

As a result of REST request the adapter should return HTTP status code:

  • 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  

Logging for received and send messages

...

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

Integration with FIXICC

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

...

  1. WrapInXmlMessage
    1. Adapter accepts any JSON
    2. Adapter creates FIX message 35=n (XML Message)
    3. Adapter stores received JSON as-is in tag 213 (XmlData)
    4. Adapter routes FIX message to BL
  2. NumericTagValueMapping
    1. Adapter accepts JSON, structured as described in JSON format for input messages section
    2. Adapter seeks tag-value pair "35":"XYZ" in incoming JSON
    3. If tag-value pair "35":"XYZ" is not found, or XYZ is not a valid FIX message type, adapter returns an error.
    4. Adapter The adapter creates empty FIX message with MsgType 35=XYZ 
    5. For every tag-value pair in JSON corresponding tags/values are filled in FIX message by Adapter
    6. Adapter routes FIX message to BL

...

Note: if you use other transport adapteradapters, just add TransportLayer.RestTA to the end of the list, e.g:

...

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

Sample A sample set of properties is given below:

...

 

Property Name

 
 

Description

 
 

Required

 
 

Default Value

 
 

TransportLayer.RestTA.Description

 
 

TA Description

 
 

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.LogCategory

 
 

Transport adaptor log category

 
 

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

 

Method 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

 
 

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 Server Parameters

 
 

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

 
 

Maximum A maximum number of threads processing HTTP requests. Allowed range is 1 – 16. 

 

N

 
 

1

 

REST TA Log settings

 

 

Log.RESTTA.Device

 

Target device for logging the received and sent messages:

File – writes log to a separate file

Console – sends a log to console window

 
 

N

 
 

 

 

 

Log.RESTTA.File.Name

 

 

File name Filename used to log the received and sent messages

 
 

N