lib/producer/high-level-producer.js
function doProduce(v, k) {
    try {
      var r = self._oldProduce(topic, partition,
        v, k,
        timestamp, opaque);

      self._hl.deliveryEmitter.once(opaque.__message_id, function(err, offset) {
        self._hl.pollingRef.decrement();
        setImmediate(function() {
          // Offset must be greater than or equal to 0 otherwise it is a null offset
          // Possibly because we have acks off
          callback(err, offset >= 0 ? offset : null);
        });
      });
      
      return r;
    } catch (e) {
      callback(e);
    }
  }
function doProduce(v, k) {
    try {
      var r = self._oldProduce(topic, partition,
        v, k,
        timestamp, opaque);

      self._hl.deliveryEmitter.once(opaque.__message_id, function(err, offset) {
        self._hl.pollingRef.decrement();
        setImmediate(function() {
          // Offset must be greater than or equal to 0 otherwise it is a null offset
          // Possibly because we have acks off
          callback(err, offset >= 0 ? offset : null);
        });
      });
      
      return r;
    } catch (e) {
      callback(e);
    }
  }
function doProduce ( v , k ) { try { var r = self . _oldProduce ( topic , partition , v , k , timestamp , opaque ) ; self . _hl . deliveryEmitter . once ( opaque . __message_id , function ( err , offset ) { self . _hl . pollingRef . decrement ( ) ; setImmediate ( function ( ) { // Offset must be greater than or equal to 0 otherwise it is a null offset // Possibly because we have acks off callback ( err , offset >= 0 ? offset : null ) ; } ) ; } ) ; return r ; } catch ( e ) { callback ( e ) ; } }
Actually do the produce with new key and value based on deserialized results
Actually do the produce with new key and value based on deserialized results