MigratoryData Client API for C++
Developer's Guide and Reference Manual
This guide includes the following sections:
This application programming interface (API) contains all the necessary operations for connecting to a cluster of one or more MigratoryData servers, subscribing to subjects, getting real-time messages for the subscribed subjects, and publishing real-time messages.
A typical API usage is as follows:
Include the headers of the API located in the folder
include of this API package.
include folder to the Include Directories of your C++ application.
The API library is available in the folder
lib of this API package. Add the
lib folder to the Library Directories of your C++ application. Also, add the API library itself to the list of Library Dependencies of your C++ application.
The log listener class should implement the MigratoryLogListener interface.
Use the API call MigratoryDataClient.setLogListener() to assign an instance of the log listener class for getting the logs of the API.
The listener class should implement the MigratoryDataListener interface.
Use the API call MigratoryDataClient.setListener() to attach your listener implementation.
Use the API method MigratoryDataClient.setServers() to specify one or more MigratoryData servers to which your C++ client will connect to. In fact, the C++ client will connect to only one of the MigratoryData servers in this list. But, defining two or more MigratoryData servers is recommended to achieve fail-over (and horizontal scalling / load balancing). Supposing the MigratoryData server - to which the C++ client connected - goes down, then the API will automatically reconnect that client to another MigratoryData server in the list.
Handle the messages received for the subscribed subjects as well as the status notifications in your listener implementation defined at Step 3 above.
Examples built with this API are available in the folder
examples of this API package; start with the README file which explains how to compile and run them.