Does Azure eventhub have a callback method?

Solution for Does Azure eventhub have a callback method?
is Given Below:

Is there any callback mechanism available in the send method of eventhubproducer for Azure
EventHub like we have for Kafka. For example the below code is for Kafka Producer:-

producer.send(producerRecord, (recordMetadata, exception) -> {
  if (exception == null) {
      System.out.println("Record written to offset " +
              recordMetadata.offset() + " timestamp " +
  } else {
      System.err.println("An error occurred");


No; the EventHubProducerClient does not defer sending of events. When you call SendAsync, the batch of events is published immediately. When that call completes, either the events were successfully acknowledged by the Event Hubs service or an exception will be surfaced.

For more information and deeper discussion of publishing events with the Event Hubs SDK, you may want to take a look at this sample.