MigratoryDataListenerΒΆ

namespace migratorydata
class MigratoryDataListener
#include <client-cpp/MigratoryDataListener.h>

The implementation of this interface will handle the messages received from the server for the subscribed subjects as well as various status notifications.

Use the API method MigratoryDataClient.setListener() to register your listener implementation.

Public Functions

void onMessage(const MigratoryDataMessage &message) = 0

This method handles the real-time messages received from a MigratoryData server for the subscribed subjects.

Parameters

void onStatus(const std::string &status, std::string &info) = 0

This method handles the status notifications.

The possible values of the status parameter are:

  • MigratoryDataClient.NOTIFY_DATA_SYNC indicates that, after a failover reconnection, the client successfully synchronized the subject given in the detail information of the status notification. Moreover, the client recovered all messages made available for that subject during the failover period, if any

  • MigratoryDataClient.NOTIFY_DATA_RESYNC indicates that, after a failover reconnection, the client successfully

    • synchronized the subject given in the detail information; however, the potential messages made available for that subject during

    • the failover period have not been recovered, the client behaving like a new client which only received the most

    • recent retained message available for that subject

  • MigratoryDataClient.NOTIFY_PUBLISH_OK indicates that the client successfully published the message having the closure data provided in the detail information of the status notification

Parameters
  • status: The type of the status notification (see the possible values above).

  • info: The detail information of the status notification.