GitHub

Projects

Destinations

You can use destination adapters to subscribe every state change and send them to Elasticsearch, Firestore or your own custom REST API. For Elasticsearch, we support only elastic.co's cloud service for now.

If your destination adapter become unavailable, Rio retries to send the state change with an exponential backoff strategy. To configure your retry behavior, you should provide delay and max count.

Please make sure that your destination adapter id is unique in your project scope.

{
    public: {}, // public state
    user: {
        [userId]: {} // state available to userId
    },
    role: {
        [roleId]: {} // state available to roleId
    },
    private: {}, // private state
}

Destinations in Templates

To use any of these destinations, you should add them into your class templates.

destinations:
    - id: yourDestinationId
ParameterTypeRequiredDescription
idstringtrueDestination's unique ID

API Reference

ParameterTypeRequiredDescription
idstringtrueDestination's unique ID
typestring (Elasticsearch, Firestore, Http)trueDestination's type
pfactornumberfalseParallelization factor. If you set this, queue will be consumed by the number you provided in parallel
retryConfig.delaynumberfalsedelay multiplexer after a failed execution
retryConfig.countnumberfalsemaximum retry count after a failed execution

Concurrency

By default, destinations have instanceId based concurrency which means each instanceId has its own queue to push messages in order. These messages will be delivered in parallel by number of active instanceIds.

If you want to manage concurrency you should provide a parallelization factor in your destination configuration. When you set an integer greater than zero, core will limit concurrent threads to that value instead of number of active instanceIds.

Elasticsearch Support

ParameterTypeRequiredDescription
cloudIdstringtrueElasti.co's cloud id
usernamestringtrueElasti.co's username
passwordstringtrueElasti.co's password
indexstringtrueIndex name to push the data into

Http Support

ParameterTypeRequiredDescription
methodstringtrueHttp method
urlstringtrueRequest url
headers.<header_name>stringfalseRequest header's name and value
Previous
Settings