code: def on_delivery(err, msg, obj):
      
      if err is not None:
          print('Message {} delivery failed for user {} with error {}'.format(
              obj.id, obj.name, err))
      else:
          print('Message {} successfully produced to {} [{}] at offset {}'.format(
              obj.id, msg.topic(), msg.partition(), msg.offset()))
docs: Handle delivery reports served from producer.poll.
          This callback takes an extra argument, obj.
          This allows the original contents to be included for debugging purposes.