Interface CommunicationProblemListener


public interface CommunicationProblemListener
Interface definition for a callback to be invoked when the agent was not able to successfully communicate with the beacon endpoint.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onError(Throwable throwable)
    Called when the agent was not able to receive an http response.
    void
    onFailure(int responseCode, String responseMessage, String body)
    Called when the agent successfully received an http response, but the response is invalid.
  • Method Details

    • onFailure

      void onFailure(int responseCode, String responseMessage, String body)
      Called when the agent successfully received an http response, but the response is invalid.

      In this case the agent does not automatically reconnect to the beacon endpoint. Adjust the agent configuration with Dynatrace.setBeaconHeaders(Map) and the agent will send a new http request (with the specified headers) to the beacon endpoint.

      Parameters:
      responseCode - status code from the received http response
      responseMessage - message from the received http response
      body - the body from the received http response
      See Also:
    • onError

      void onError(Throwable throwable)
      Called when the agent was not able to receive an http response.

      In this case the agent will wait a certain amount of time and then tries to reconnect to the beacon endpoint.

      Parameters:
      throwable - the reason why the agent was not able receive an http response
      See Also: