code: function(client, stopProcessingCallback, callback) {
    logger.entry('stopMessenger', client.id);
    logger.log('parms', client.id, 'stopProcessingCallback:',
               stopProcessingCallback);
    logger.log('parms', client.id, 'callback:', callback);
  
    var cb = function() {
      if (stopProcessingCallback) {
        stopProcessingCallback(client, callback);
      }
    };
  
    // If messenger available then request it to stop
    // (otherwise it must have already been stopped)
    try {
      if (client._messenger) {
        logger.log('debug', client.id, 'disconnecting messenger');
        client._messenger.disconnect().then(function() {
          logger.log('debug', client.id, 'messenger disconnected');
          process.nextTick(cb);
        }).catch(function(err) {
          logger.caught('stopMessenger', client.id, err);
          callback(err);
        }).error(function(err) {
          logger.caught('stopMessenger', client.id, err);
          callback(err);
        });
      } else {
        logger.log('debug', client.id, 'no active messenger to stop');
        cb();
      }
    } catch (err) {
      console.error(util.inspect(err, true));
    }
  
    logger.exit('stopMessenger', client.id);
  }
docs: @param {function(object)}
  stopProcessingCallback - callback to perform post stop processing.
  @param {client} client - the client object to stop the messenger for.
  @param {callback}
  callback - passed an error object if something goes wrong.
   
  Stops the messenger.  The messenger stop function merely requests it to stop,
  so we need to keep checking until it is actually stopped. Then any post
  stop processing can be performed.
  
  @param {client} client - the client object to stop the messenger for.
  @param {stopProcessingCallback}
  stopProcessingCallback - Function to perform the required post stop
  processing.
  @param {callback}
  callback - (optional) The application callback to be notified of
  errors and completion (passed to the stopProcessingCallback).