Skip to main content

React to changes in FA data

You can integrate the FA Platform with your external system to receive messages about and react to changes in FA data. This allows you to, for example, implement API calls to fetch updated information that your external system uses. To start using this functionality, contact FA.

If you want to synchronize information about contacts, portfolios, securities, transactions, or trade orders, see Receive messages about core data type changes. If you want to synchronize information about positions or purchase lots, see Receive messages about report data calculations.

Receive messages about core data type changes

You can receive messages when contacts, portfolios, securities, transactions, or trade orders are inserted, modified, or deleted in FA. The messages are sent to a service bus topic called “data-changes” and are available for up to 7 days. The messages only indicate the data type, the action (create, update, or delete), and the object ID. The following are example messages about changes to core data types:

Data type

Create

Update

Delete

Contact

{"dataType":0,"action":0,"id":10674998}

{"dataType":0,"action":1,"id":10674998}

{"dataType":0,"action":2,"id":10674998}

Portfolio

{"dataType":1,"action":0,"id":10776195}

{"dataType":1,"action":1,"id":10776195}

{"dataType":1,"action":2,"id":10776195}

Security

{"dataType":2,"action":0,"id":10745094}

{"dataType":2,"action":1,"id":10745094}

{"dataType":2,"action":2,"id":10745094}

Transaction

{"dataType":3,"action":0,"id":29803728}

{"dataType":3,"action":1,"id":29803728}

{"dataType":5,"action":2,"id":29803728}

Trade order

{"dataType":4,"action":0,"id":29803729}

{"dataType":4,"action":1,"id":29803729}

{"dataType":5,"action":2,"id":29803729}

Receive messages about report data calculations

You can receive messages when the FA system completes purchase lot or position calculations. The messages are sent to a service bus topic called "report-calculation-events" and are available for up to 7 days. The message content matches the original report data calculation request. The following is an example message about completed report data calculations:

{
    "portfolioIds": 10527961,
    "date": 1612130400000,
    "type": "LATEST",
    "name": "1631619219707-10527961",
    "group": "REPORTS-10527961",
    "description": "UpdateReportFromLatestDate-10527961",
    "key": "REPORTS-10527961.1631619219707-10527961"
}

The following information is relevant for your external integrations:

  • portfolioIds (Long data type). The database ID of the portfolio that was recalculated.

  • date (Unix timestamp). The date from which onward the report data calculation was done. If blank, report data was calculated from the beginning of the portfolio, or if type is "LATEST", report data calculation was only done for dates without positions.

  • type. The type of report data calculation executed. The options are:

    • LATEST. Calculated positions only starting from a given date.

    • FULL. Calculated purchase lots and positions starting from a given date.

    • FULL-ALL. Calculated purchase lots and positions starting from the beginning.

    • SUB. Calculated purchase lots only.

    • REMOVE. Removed position and purchase lot data for the given portfolio.

  • name. A combination of a timestamp (when the report data calculation was triggered) and the portfolio ID.

Define custom integrations to service bus topics

FA Developer allows you to gain value from the messages you receive about data changes when you define custom integrations to the service bus topics. The following is an example Camel route that prints the content of messages arriving in the “data-changes” topic:

<route id="custom-data-changes-listener">
    <from uri="amqp:topic:data-changes/subscriptions/customlistener"/>
    <log message="Received message: ${body}"/>
</route>

In this example, the messages are simply recorded in connector microservice system logs. To synchronize FA Platform data with your external system, you can use Apache Camel (for example, REST API) to send the message content to your external system.