MigratoryData Client API for C++
Developer's Guide and Reference Manual
MigratoryDataListener Class Referenceabstract

Implementations of this interface can handle the real-time messages received for the subscribed subjects as well as various status notifications. More...

Public Member Functions

virtual void onMessage (const MigratoryDataMessage &message)=0
 This method handles the real-time messages received from a MigratoryData server for the subscribed subjects. More...
 
virtual void onStatus (const std::string &status, std::string &info)=0
 This method handles the status notifications. More...
 

Detailed Description

Implementations of this interface can handle the real-time messages received for the subscribed subjects as well as various status notifications.

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

Member Function Documentation

◆ onMessage()

virtual void MigratoryDataListener::onMessage ( const MigratoryDataMessage message)
pure virtual

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

Parameters
messageAn object of type MigratoryDataMessage .

◆ onStatus()

virtual void MigratoryDataListener::onStatus ( const std::string &  status,
std::string &  info 
)
pure virtual

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 received the messages published during the failover period for this subject.
  • MigratoryDataClient.NOTIFY_DATA_RESYNC indicates that, after a failover reconnection, the client successfully synchronized the subject given in the detail information of the status notification. However, the client have not received the potential messages published during the failover period for this subject, the client behaving like a new client which just connected to the MigratoryData server.
  • 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
  • MigratoryDataClient.NOTIFY_PUBLISH_NO_SUBSCRIBER indicates that the client was unable to publish the message having the closure data provided in the detail information of the status notification because there is no client subscribed to the subject of the message
Parameters
statusThe type of the status notification (see the possible values above).
infoThe detail information of the status notification.