All Products
Search
Document Center

ApsaraMQ for RabbitMQ:Error codes

Last Updated:Mar 11, 2026

When an ApsaraMQ for RabbitMQ client calls an AMQP 0-9-1 method, the broker returns a reply code and reply text to indicate success or failure. Use the following tables to identify the root cause of an error and apply the recommended fix.

How to read an error response

Each error response contains the following fields:

FieldDescriptionExample
reply-codeThe numeric error code.404
reply-textThe error identifier.ExchangeNotExist
ReqIdA unique request ID for tracking.5FB4C999314635F952FCBFF6
ErrorHelpTroubleshooting metadata, including related resource names and a link to this reference.[dstQueue=XXX_test_queue,srcExchange=Producer.ExchangeName,routingKey=XXX_test_bk,http://mrw.so/6rNqO8]
class-idThe AMQP class ID. Matches open-source RabbitMQ.50
method-idThe AMQP method ID. Matches open-source RabbitMQ.20
Note

When a basicPublish call fails, ErrorHelp returns only the msgId to reduce performance overhead. The key-value structure is not included. Use the msgId to trace the failed publish.

Sample stack trace

Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>
(reply-code=404, reply-text=ExchangeNotExist, ReqId:5FB4C999314635F952FCBFF6, ErrorHelp[dstQueue=XXX_test_queue,
srcExchange=Producer.ExchangeName,routingKey=XXX_test_bk, http://mrw.so/6rNqO8], class-id=50, method-id=20)
    at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:516)
    at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:346)
    at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:182)
    at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:114)
    at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:672)
    at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:48)
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:599)
    at java.lang.Thread.run(Thread.java:748)

Error severity

ApsaraMQ for RabbitMQ errors fall into two categories:

  • Channel-level (soft) errors close only the affected channel. The connection stays open, and you can open a new channel to retry. Most errors in the tables below are channel-level.

  • Connection-level (hard) errors close the entire connection. All channels on that connection are lost. Errors such as 320 ProtocolVersionMismatch and 541 InternalError are connection-level.

Protocol and authentication errors

Reply codeReply textDescriptionSolution
320ProtocolVersionMismatchThe client uses an unsupported protocol version. Only AMQP 0-9-1 is supported.Use the AMQP 0-9-1 protocol.
403AccessDeniedByRamPolicyThe RAM user does not have the required permissions.Grant the required permissions to the RAM user. For details, see RAM access policies.
530AccessAccountDataErrorAuthentication failed with the provided username and password.Make sure that:
  • The static username and password are correct.
  • The credentials belong to the current instance.
  • The AccessKey ID and AccessKey secret used to generate the static credentials are valid.

Resource not found errors

These errors occur when a basicPublish, BasicConsume, bind, or declare operation references a resource that does not exist.

Reply codeReply textDescriptionSolution
200no route has mandatoryThe basicPublish method was called with mandatory set to true, but the exchange found no matching queue for the routing key. The broker returned the message to the producer through basic.return.Check the exchange bindings. Make sure that a queue is bound with a routing key that matches the published message.
404ExchangeNotExistThe specified exchange does not exist.
  • Create the exchange before you reference it.
  • Check the exchange name for typos.
404QueueNotExistThe specified queue does not exist.
  • Create the queue before you reference it.
  • Check the queue name for typos.

Declaration and validation errors

These errors occur when you declare or bind exchanges and queues, typically due to invalid names or property mismatches.

Reply codeReply textDescriptionSolution
405QueueExclusiveThe queue is exclusive to the connection that created it.Access the queue only from its declaring connection. Other connections cannot consume from or declare an exclusive queue.
406ExchangeNameEmptyNo exchange name was provided.Specify a non-empty exchange name. For naming requirements, see Limits.
406ExchangeInBuiltExchanges with names starting with amq. are reserved by the system.Choose a different exchange name that does not start with amq..
406QueueNameInvalidThe queue name contains invalid characters or exceeds length limits.Fix the queue name. For naming requirements, see Limits.
406QueueConsumerNameInvalidThe consumer name contains invalid characters or exceeds length limits.Fix the consumer name. For naming requirements, see Limits.
406BindingNameInvalidThe routing key contains invalid characters or exceeds length limits.Fix the routing key. For naming requirements, see Limits.
406QueueHasDiffFieldThe properties in the queue declaration do not match the existing queue on the server.Update the declaration parameters to match the existing queue properties. For details, see QueueHasDiffField.
530ExchangeHasDiffFieldsThe properties in the exchange declaration do not match the existing exchange on the server.Update the declaration parameters to match the existing exchange properties. For details, see ExchangeHasDiffFields.

Message errors

Reply codeReply textDescriptionSolution
311MessageBodyLengthExceededThe message body exceeds the maximum allowed size.Reduce the message size. For size limits, see Limits.
406MessageBodyEmptyThe message body is empty.Include content in the message body.

Delayed message exchange errors

Reply codeReply textDescriptionSolution
503ExchangeTypeNotSupport[x-delayed-message]The x-delayed-message exchange was declared with incorrect parameters.Set the exchange type to x-delayed-message and specify a valid x-delayed-type argument. Example:
arguments.put("x-delayed-type", "The value can only be direct, topic, fanout, or headers");
channel.exchangeDeclare("${exchangeName}", "The value can only be x-delayed-message", true, false, arguments);

Channel and connection errors

Reply codeReply textDescriptionSolution
504ChannelNotFindThe channel was released while a message was in transit. This typically happens when multiple threads share a connection and frequently open and close connections.If you use Spring Boot with the connection factory in CONNECTION mode, increase spring.rabbitmq.cache.connection.size to reduce the rate of connection churn.
530ChannelNumExceededThe number of channels on a single connection exceeds the limit.Close unused producer or consumer channels.
530ConnectionNumExceededThe number of connections on a single instance exceeds the limit.
  • Reuse existing connections instead of creating one per request.
  • Upgrade the instance type to raise the connection limit. For limits, see Limits.
530QueueConsumerAlreadyExistA consumer with the same consumer tag already exists on the queue.Specify a unique ConsumerTag value when you call BasicConsume on the same channel.

Resource quota errors

These errors occur when an instance, vhost, or resource reaches its quota. To raise quotas, upgrade the instance configuration. For default limits, see Limits.

Reply codeReply textDescriptionSolution
530denied for too many requestsThe peak TPS for sending or receiving messages exceeds the instance limit. The request is throttled.
530VhostNumExceededThe number of vhosts in the instance exceeds the limit.
  • Delete unused vhosts.
  • Upgrade the instance type.
530ExchangeNumExceededThe number of exchanges in a single vhost exceeds the limit.
  • Delete unused exchanges or vhosts.
  • Upgrade the instance type.
530QueueNumExceededThe number of queues in the instance exceeds the limit.
  • Delete unused queues.
  • Upgrade the instance configuration.
530VHostTotalBindingNumExceededThe number of bindings in a single vhost exceeds the limit.
  • Delete unused bindings.
  • Upgrade the instance configuration.
530ExchangeBindingNumExceededThe number of queues bound to a single exchange exceeds the limit.Remove unused queue bindings from the exchange.
530QueueConsumerNumExceededThe number of consumers on a single queue exceeds the limit.
  • Remove unused consumer subscriptions.
  • Upgrade the instance configuration.

Internal errors

Reply codeReply textDescriptionSolution
541InternalErrorAn internal server error occurred.Check the reply-text for details and submit a ticket to contact ApsaraMQ for RabbitMQ technical support.