public Consumer createConsumer(Connection connection, Stats stats, String id) throws IOException {
Channel channel = connection.createChannel();
if (consumerTxSize > 0) channel.txSelect();
String qName = configureQueue(connection, id);
if (consumerPrefetch > 0) channel.basicQos(consumerPrefetch);
if (channelPrefetch > 0) channel.basicQos(channelPrefetch, true);
return new Consumer(channel, id, qName,
consumerTxSize, autoAck, multiAckEvery,
stats, consumerRateLimit, consumerMsgCount, timeLimit);
}