{
_log.info("Binding queue " + queue + " to exchange " + exch + " with routing key " + routingKey);
}
final MethodRegistry registry = session.getMethodRegistry();
final AMQMethodBody responseBody;
if (registry instanceof MethodRegistry_0_9)
{
responseBody = ((MethodRegistry_0_9)registry).createQueueUnbindOkBody();
}
else if (registry instanceof MethodRegistry_0_91)
{
responseBody = ((MethodRegistry_0_91)registry).createQueueUnbindOkBody();
}
else
{
// 0-8 does not support QueueUnbind
throw new AMQException(AMQConstant.COMMAND_INVALID, "QueueUnbind not present in AMQP version: " + session.getProtocolVersion(), null);
}
channel.sync();
session.writeFrame(responseBody.generateFrame(channelId));
}