amplitude/Amplitude-Java

SDK does not call callback

douglasqueirozalmeida opened this issue · 2 comments

Expected Behavior

When use a batch of 10 events or 30 millisec, when the quantity or time is reached the SDK should trigger the callback for each event that was added.

Current Behavior

I am using a batch of 10 events or 30 millisec (or other values), when the quantity or time is reached the SDK triggers the callback (onLogEventServerResponse) only once.

Steps to Reproduce

  private val callBackAmplitude = object : AmplitudeCallbacks() {
      override fun onLogEventServerResponse(event: AmplitudeEvent, status: Int, message: String?) {
        logger.warn("Status: $status - Message: $message - Event: $event")
      }
    }

 val client = Amplitude.getInstance().also {
    it.init(apiKey)
    it.setEventUploadThreshold(10)
    it.setEventUploadPeriodMillis(30000)
    it.useBatchMode(true)
    it.setCallbacks(callBackAmplitude)
  }
 client.logEvent(event)

Environment

  • implementation 'com.amplitude:java-sdk:1.12.0'

Guys, sorry for the issue, there is no problem, the SDK works correctly.
It would be interesting to add documentation stating that any error that occurs in the callback will not be propagated. This happens due to the thread that the SDK runs.