body.getExclusive(),
body.getNoLocal());
if (!body.getNowait())
{
MethodRegistry methodRegistry = protocolConnection.getMethodRegistry();
AMQMethodBody responseBody = methodRegistry.createBasicConsumeOkBody(consumerTag);
protocolConnection.writeFrame(responseBody.generateFrame(channelId));
}
}
else
{
AMQShortString msg = AMQShortString.validValueOf("Non-unique consumer tag, '" + body.getConsumerTag() + "'");
MethodRegistry methodRegistry = protocolConnection.getMethodRegistry();
AMQMethodBody responseBody = methodRegistry.createConnectionCloseBody(AMQConstant.NOT_ALLOWED.getCode(), // replyCode
msg, // replytext
body.getClazz(),
body.getMethod());
protocolConnection.writeFrame(responseBody.generateFrame(0));
}
}
catch (AMQInvalidArgumentException ise)
{
_logger.debug("Closing connection due to invalid selector");
MethodRegistry methodRegistry = protocolConnection.getMethodRegistry();
AMQMethodBody responseBody = methodRegistry.createChannelCloseBody(AMQConstant.ARGUMENT_INVALID.getCode(),
AMQShortString.validValueOf(ise.getMessage()),
body.getClazz(),
body.getMethod());
protocolConnection.writeFrame(responseBody.generateFrame(channelId));
}
catch (AMQQueue.ExistingExclusiveConsumer e)
{