Interface Callback


public interface Callback
Callback invoked when the client library is done processing a message.

Methods may be called on background threads, implementations must implement their own synchronization if needed. Implementations should also take care to make the methods non-blocking.

  • Method Summary

    Modifier and Type Method Description
    void failure​(com.segment.analytics.messages.Message message, Throwable throwable)
    Invoked when the library gives up on sending a message.
    void success​(com.segment.analytics.messages.Message message)
    Invoked when the message is successfully uploaded to Segment.
  • Method Details

    • success

      void success​(com.segment.analytics.messages.Message message)
      Invoked when the message is successfully uploaded to Segment.

      Note: The Segment HTTP API itself is asynchronous, so this doesn't indicate whether the message was sent to all integrations or not — just that the message was sent to the Segment API and will be sent to integrations at a later time.

    • failure

      void failure​(com.segment.analytics.messages.Message message, Throwable throwable)
      Invoked when the library gives up on sending a message.

      This could be due to exhausting retries, or other unexpected errors. Use the throwable provided to take further action.