Class EventBatchSender


  • public class EventBatchSender
    extends java.lang.Object
    • Method Detail

      • sendBatch

        public Response sendBatch​(EventBatch batch)
                           throws ResponseException
        Send a batch of events to New Relic.
        Parameters:
        batch - The batch to send. This batch will be drained of accumulated events as a part of this process.
        Returns:
        The response from the ingest API.
        Throws:
        ResponseException - In cases where the batch is unable to be successfully sent, one of the subclasses of ResponseException will be thrown. See the documentation on that hierarchy for details on the recommended ways to respond to those exceptions.
      • create

        public static EventBatchSender create​(java.util.function.Supplier<HttpPoster> httpPosterCreator,
                                              BaseConfig baseConfig)
        Creates a new EventBatchSender with the given supplier of HttpPoster impl and a BaseConfig instance, with all configuration NOT in BaseConfig being default.
        Parameters:
        httpPosterCreator - A supplier that returns an HttpPoster for this EventBatchSender to use.
        baseConfig - basic configuration for the sender
        Returns:
        a shiny new EventBatchSender instance
      • returnEndpoint

        public static java.net.URL returnEndpoint​(java.lang.String userRegion)
                                           throws java.net.MalformedURLException
        Throws:
        java.net.MalformedURLException