All Products
Search
Document Center

ApsaraMQ for RabbitMQ:Error codes returned when AMQP methods are called

Last Updated:Mar 15, 2024

This topic describes the error codes returned when an ApsaraMQ for RabbitMQ client calls Advanced Message Queuing Protocol (AMQP) 0-9-1. You can troubleshoot errors based on the error messages and solutions provided in this topic.

Error codes

Returned code

Returned error message

Description

Solution

200

no route has mandatory

The error message returned because when the basicPublish method is called to send a message and the mandatory parameter is set to true, the broker calls the basic.return method to return the message to the producer if the exchange cannot match a queue to store the message based on the exchange type and the routing key.

Check whether the binding of the exchange is correctly specified.

311

MessageBodyLengthExceeded

The error message returned because the size of the message exceeds the upper limit.

Make sure that the size of your message does not exceed the upper limit that is specified by ApsaraMQ for RabbitMQ. For more information, see Limits.

320

ProtocolVersionMismatch

The error message returned because the AMQP version is invalid. ApsaraMQ for RabbitMQ supports only AMQP 0-9-1.

Make sure that your AMQP version is 0-9-1.

403

AccessDeniedByRamPolicy

The error message returned because the specified Resource Access Management (RAM) user is not granted the permissions to perform the operation.

Make sure that the required permissions are granted to your RAM user. For more information, see RAM policies.

404

ExchangeNotExist

The error message returned because the exchange does not exist.

  • Make sure that the specified exchange has been created.

  • Make sure that the specified exchange is valid.

QueueNotExist

The error message returned because the queue does not exist.

  • Make sure that the specified queue has been created.

  • Make sure that the specified queue is valid.

405

QueueExclusive

The error message returned because the queue is an exclusive queue.

Make sure that your connection is the first connection from which the queue was accessed. The queue is visible only to the connection from which the queue was accessed. You cannot access the queue from other connections.

406

QueueConsumerNameInvalid

The error message returned because the name of the consumer for the queue does not meet the naming conventions.

Make sure that the specified consumer name is valid. For more information, see Limits on string characters.

ExchangeNameEmpty

The error message returned because the exchange name is empty.

Make sure that the exchange has been created and that the specified exchange name is valid. For more information, see Limits on string characters.

QueueHasDiffField

The error message returned because the attribute value of the queue in the local declaration is different from the attribute value of the queue that you want to use.

Change the attribute value of the queue in the local declaration to ensure that the value is the same as the attribute value of the queue that you want to use. For more information, see How do I troubleshoot a QueueHasDiffField error that is reported on the ApsaraMQ for RabbitMQ client?

BindingNameInvalid

The error message returned because the binding key name does not meet the naming conventions.

Make sure that the binding key name that you entered is valid. For more information, see Limits on string characters.

ExchangeInBuilt

The error message returned because the exchange is a built-in exchange and cannot be created.

Change the exchange name. Exchanges whose names are prefixed with amp. are built-in exchanges. You cannot create built-in exchanges.

QueueNameInvalid

The error message returned because the queue name does not meet the naming conventions.

Make sure that the specified queue name is valid. For more information, see Limits on string characters.

MessageBodyEmpty

The error message returned because the message body is empty.

Enter the message body.

503

ExchangeTypeNotSupport[x-delayed-message]

The error message returned because the parameters were incorrectly configured when you created an x-delayed-message exchange by using code.

Check whether the exchange type and the value of the x-delay-type parameter are correctly specified. Correct examples:

  • arguments.put("x-delayed-type", "Valid values: direct, topic, fanout, headers, and x-jms-topic ");

  • channel.exchangeDeclare("${exchangeName}", "Valid values: x-delayed-message", true, false, and arguments);

504

ChannelNotFind

The error message returned because the channel is cleared when the information is transmitted to the broker.

This error code is returned if multiple processes share a connection and the connection is frequently established and closed.

If you use Spring Boot to integrate with ApsaraMQ for RabbitMQ and set the connection factory to the CONNECTION mode, you can change the number of cached connections by configuring the spring.rabbitmq.cache.connection.size parameter. This way, the client does not frequently establish or close connections to the broker.

530

ExchangeHasDiffFields

The error message returned because the attribute value of the exchange in the local declaration is different from the attribute value of the exchange that you want to use.

Change the attribute value of the exchange in the local declaration to ensure that the value is the same as the attribute value of the exchange that you want to use. For more information, see How do I deal with an ExchangeHasDiffFields error that is reported on the ApsaraMQ for RabbitMQ client?

denied for too many requests

The error message returned because the request is throttled. This occurs because the messaging transactions per second (TPS) exceeds the specification limit.

  • Control the traffic to ensure that the messaging TPS does not exceed the specification limit. For more information, see Best practices for instance throttling.

  • Upgrade the instance to increase the maximum messaging TPS. For more information, see Limits.

VhostNumExceeded

The error message returned because the number of vhosts on a single instance exceeds the upper limit.

  • Delete the vhosts that you no longer require.

  • Upgrade the instance to increase the maximum number of vhosts. For more information, see Limits.

ExchangeNumExceeded

The error message returned because the number of exchanges on a single vhost exceeds the upper limit.

  • Delete the vhosts that you no longer require.

  • Upgrade the instance to increase the maximum number of exchanges. For more information, see Limits.

QueueNumExceeded

The error message returned because the number of queues on a single instance exceeds the upper limit.

VHostTotalBindingNumExceeded

The error message returned because the number of bindings on a single vhost exceeds the upper limit.

ExchangeBindingNumExceeded

The error message returned because the number of queues to which a single exchange is bound exceeds the upper limit.

Unbind the exchanges from the queues that you no longer require.

QueueConsumerNumExceeded

The error message returned because the number of consumers in a single queue exceeds the upper limit.

ChannelNumExceeded

The error message returned because the number of channels on a single connection exceeds the upper limit.

Shut down the producer or consumer processes that you no longer require.

AccessAccountDataError

The error message returned because the username and password failed to be authenticated.

  • Check whether the static username and password are correctly specified.

  • Check whether the specified static username and password are the username and password of the instance.

  • Check whether the AccessKey pair that is used to create the static username and static password is correct.

541

InternalError

The error message returned because an internal error occurred on the broker.

Identify the cause of the issue based on the returned error code and then submit a ticket to contact ApsaraMQ for RabbitMQ technical support.

Sample response

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,bindingKey=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)

Response parameters

Parameter

Description

Example

reply-code

The returned code.

404

reply-text

The returned message.

ExchangeNotExist

ReqId

The request ID.

5FB4C999314635F952FCBFF6

ErrorHelp

The information that helps troubleshoot the error. The following information is included:

  • Related metadata when the error occurred.

  • Links for the error codes returned when the AMQP methods are called.

Note

If an error occurs when an ApsaraMQ for RabbitMQ client calls the BasicPublish method, the ErrorHelp parameter provides only a message ID but does not provide the help information formatted as key-value pairs. You can troubleshoot the error based on the message ID. This improves performance and reduces memory overheads.

[dstQueue=XXX_test_queue,srcExchange=Producer.ExchangeName,bindingKey=XXX_test_bk,http://mrw.so/6rNqO8]

class-id

The class ID. This parameter is used in the same way as in open source RabbitMQ.

50

method-id

The method ID. This parameter is used in the same way as in open source RabbitMQ.

20