_consumeCB(cmd, needAck = false) {
		return msg => {
			const result = this.receive(cmd, msg.content);

			// If a promise is returned, acknowledge the message after it has resolved.
			// This means that if a worker dies after receiving a message but before responding, the
			// message won't be lost and it can be retried.
			if (needAck) {
				if (isPromise(result)) {
					return result
						.then(() => {
							if (this.channel) this.channel.ack(msg);
						})
						.catch(err => {
							this.logger.error("Message handling error.", err);
							if (this.channel) this.channel.nack(msg);
						});
				} else if (this.channel) {
					this.channel.ack(msg);
				}
			}

			return result;
		};
	}
Build a function to handle requests.

@param {String} cmd
@param {Boolean} needAck

@memberof AmqpTransporter