try
{
final boolean immediate = _incommingMessage.isImmediate();
final AMQMessage amqMessage = createAMQMessage(_incommingMessage);
MessageReference ref = amqMessage.newReference();
for(int i = 0; i < _destinationQueues.size(); i++)
{
BaseQueue queue = _destinationQueues.get(i);
BaseQueue.PostEnqueueAction action;
if(immediate)
{
action = new ImmediateAction(queue);
}
else
{
action = null;
}
queue.enqueue(amqMessage, isTransactional(), action);
if(queue instanceof AMQQueue)
{
((AMQQueue)queue).checkCapacity(AMQChannel.this);
}
}
_incommingMessage.getStoredMessage().flushToStore();
ref.release();
}
catch (AMQException e)
{
// TODO
throw new RuntimeException(e);