@Override public void receiveTxCommit() { if(LOGGER.isDebugEnabled()) { LOGGER.debug("RECV[" + _channelId + "] TxCommit"); } if (!isTransactional()) { closeChannel(ErrorCodes.COMMAND_INVALID, "Fatal error: commit called on non-transactional channel"); } else { commit(new Runnable() { @Override public void run() { _connection.writeFrame(_txCommitOkFrame); } }, true); } }
@Override public void receiveTxRollback() { if(LOGGER.isDebugEnabled()) { LOGGER.debug("RECV[" + _channelId + "] TxRollback"); } if (!isTransactional()) { closeChannel(ErrorCodes.COMMAND_INVALID, "Fatal error: rollback called on non-transactional channel"); } else { final MethodRegistry methodRegistry = _connection.getMethodRegistry(); final AMQMethodBody responseBody = methodRegistry.createTxRollbackOkBody(); Runnable task = () -> _connection.writeFrame(responseBody.generateFrame(_channelId)); rollback(task); // TODO: This is not spec compliant but we currently seem to rely on this behaviour resend(); } }
if (exchange == null) closeChannel(ErrorCodes.NOT_FOUND, "No such exchange: '" + exchangeStr + "'"); closeChannel(ErrorCodes.IN_USE, "Exchange has bindings"); closeChannel(ErrorCodes.NOT_ALLOWED, "Exchange in use as an alternate binding destination"); closeChannel(ErrorCodes.NOT_ALLOWED, "Exchange '" + exchangeStr + "' cannot be deleted");
@Override public void receiveMessageHeader(final BasicContentHeaderProperties properties, final long bodySize) { if(LOGGER.isDebugEnabled()) { LOGGER.debug("RECV[" + _channelId + "] MessageHeader[ properties: {" + properties + "} bodySize: " + bodySize + " ]"); } if(hasCurrentMessage()) { if(bodySize > _connection.getMaxMessageSize()) { properties.dispose(); closeChannel(ErrorCodes.MESSAGE_TOO_LARGE, "Message size of " + bodySize + " greater than allowed maximum of " + _connection.getMaxMessageSize()); } else { publishContentHeader(new ContentHeaderBody(properties, bodySize)); } } else { properties.dispose(); _connection.sendConnectionClose(ErrorCodes.COMMAND_INVALID, "Attempt to send a content header without first sending a publish frame", _channelId); } }
closeChannel(ErrorCodes.MESSAGE_TOO_LARGE, "Channel flow control was requested, but not enforced by sender"); closeChannel(ErrorCodes.NOT_FOUND, "Unknown exchange name: '" + exchangeName + "'");
closeChannel(ErrorCodes.NOT_FOUND, "No such queue, '" + queueName + "'");
? "No default queue defined on channel and queue was null" : "Queue '" + queueName + "' does not exist."; closeChannel(ErrorCodes.NOT_FOUND, message); closeChannel(ErrorCodes.NOT_FOUND, "Exchange '" + exchange + "' does not exist."); closeChannel(ErrorCodes.NOT_FOUND, "No such binding");
closeChannel(ErrorCodes.NOT_FOUND, "Queue '" + queueName + "' does not exist."); closeChannel(ErrorCodes.IN_USE, "Queue: '" + queueName + "' is not empty."); closeChannel(ErrorCodes.IN_USE, "Queue: '" + queueName + "' is still used.");
? "No default queue defined on channel and queue was null" : "Queue " + queueName + " does not exist."; closeChannel(ErrorCodes.NOT_FOUND, message); if (exch == null) closeChannel(ErrorCodes.NOT_FOUND, "Exchange '" + exchangeName + "' does not exist.");
if (queue == null) closeChannel(ErrorCodes.NOT_FOUND, "Queue: '" + queueName closeChannel(ErrorCodes.ALREADY_EXISTS, "Cannot re-declare queue '" + queue.getName() : LifetimePolicy.PERMANENT))) closeChannel(ErrorCodes.ALREADY_EXISTS, "Cannot re-declare queue '" + queue.getName()
if (exchange == null) closeChannel(ErrorCodes.NOT_FOUND, "Unknown exchange: '" + exchangeName + "'");
closeChannel(ErrorCodes.NOT_FOUND, "Queue '" + queueName + "' does not exist.");