Getting started
A typical API usage is as follows:
Step 1 - Include the library
Use the following to include the library:
require_once '../../lib/migratorydata-client.php';
Step 2 - Attach an authorization token
Use the method MigratoryDataClient.setEntitlementToken()
to assign an
authorization token to the client.
Step 3 - Specify where to connect to
Use the API method MigratoryDataClient.setServers()
to specify one or
more MigratoryData servers to which your client will connect to. In
fact, the 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. Supposing the MigratoryData server to
which the client connected goes down, then the API will automatically
reconnect to another MigratoryData server in the list.
Step 4 - Connect to the MigratoryData cluster
Use the API method MigratoryDataClient.connect()
to connect to the
cluster and you will be able to publish messages.
Step 5 - Create messages
Use the class MigratoryDataMessage
to create messages.
Step 6 - Publish messages
Use the API method MigratoryDataClient.publish()
to publish messages.
Examples
Examples built with this API are available in the folder examples
of
this API package; start with the README file which explains how to run
them.