Interface EventSender

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable

    public interface EventSender
    extends java.io.Closeable
    Interface for a component that can deliver preformatted event data.

    By default, the SDK sends event data to the LaunchDarkly events service via HTTP. You may provide a different implementation of event delivery by implementing this interface-- for instance, to create a test fixture, or to store the data somewhere else.

    Since:
    4.14.0
    See Also:
    EventProcessorBuilder.eventSender(ComponentConfigurer)
    • Method Detail

      • sendAnalyticsEvents

        EventSender.Result sendAnalyticsEvents​(byte[] data,
                                               int eventCount,
                                               java.net.URI eventsBaseUri)
        Attempt to deliver an analytics event data payload.

        This method will be called synchronously from an event delivery worker thread.

        Parameters:
        data - the preformatted JSON data, in UTF-8 encoding
        eventCount - the number of individual events in the data
        eventsBaseUri - the configured events endpoint base URI
        Returns:
        a EventSender.Result
      • sendDiagnosticEvent

        EventSender.Result sendDiagnosticEvent​(byte[] data,
                                               java.net.URI eventsBaseUri)
        Attempt to deliver a diagnostic event data payload.

        This method will be called synchronously from an event delivery worker thread.

        Parameters:
        data - the preformatted JSON data, in UTF-8 encoding
        eventsBaseUri - the configured events endpoint base URI
        Returns:
        a EventSender.Result