After you create a static username and its password in the Message Queue for RabbitMQ console, you can connect to Message Queue for RabbitMQ by using RabbitMQ SDKs. This way, you do not need to use Message Queue for RabbitMQ SDKs to generate a dynamic username and its password.

RabbitMQ SDKs (Recommended)

Message Queue for RabbitMQ is compatible with RabbitMQ. Before you connect to Message Queue for RabbitMQ by using RabbitMQ SDKs, you must create a static username and its password. For more information, see Create a static username/password pair.

RabbitMQ provides SDKs for various programming languages and frameworks. For more information, see Clients Libraries and Developer Tools.

The following table describes the parameters that you must set when you use RabbitMQ SDKs to connect to Message Queue for RabbitMQ.

Parameter Example Description
hostName 1880770****.mq-amqp.cn-hangzhou-a.aliyuncs.com The endpoint that is used to connect to the Message Queue for RabbitMQ instance. You can view the endpoint on the Instances page in the Message Queue for RabbitMQ console. For more information, see View instance details.
userName MjoxODgwNzcwODY5MD**** The static username that is generated in the Message Queue for RabbitMQ console. Message Queue for RabbitMQ encodes the AccessKey pair of your Alibaba Cloud account or a RAM user within the account and the ID of an Message Queue for RabbitMQ instance in Base64 to obtain a static username.
passWord NDAxREVDQzI2MjA0OT**** The static password that is generated in the Message Queue for RabbitMQ console. Message Queue for RabbitMQ uses the HMAC-SHA1 algorithm to generate a signature based on the AccessKey secret of your Alibaba Cloud account or a RAM user within the account and the timestamp parameter, which indicates the current system time. Then, Message Queue for RabbitMQ encodes the signature and the timestamp parameter in Base64 to obtain a static password.
virtualHost Test The name of the Message Queue for RabbitMQ vhost. You can view the vhost name on the vhosts page in the Message Queue for RabbitMQ console. For more information, see View vhost details.
Note Message Queue for RabbitMQ is compatible with RabbitMQ. For more information about parameters, see the client documentation of RabbitMQ.

Message Queue for RabbitMQ SDKs (Not recommended)

Message Queue for RabbitMQ SDKs are used only to generate a dynamic username and its password based on an AccessKey ID and an AccessKey secret. After you obtain the dynamic username and password, you still need to use RabbitMQ SDKs to connect to Message Queue for RabbitMQ.

The following table describes Message Queue for RabbitMQ SDKs for multiple programming languages and frameworks.

Programming language or framework SDK
C++ amqp-cpp-demo
.NET amqp-dotnet-demo
Go amqp-go-utils
Node.js amqp-node-demo
PHP amqp-php-demo
Python
Ruby amqp-ruby-demo
Java
Spring

The following table describes the parameters that you must set when you use Message Queue for RabbitMQ SDKs to connect to Message Queue for RabbitMQ.

Parameter Example Description
accessKey LTAI4FwQ5aK1mFYC**** The AccessKey ID of your Alibaba Cloud account or a RAM user within the account. You can obtain the AccessKey ID from the Alibaba Cloud Management Console. For more information, see Obtain an AccessKey pair.
accessSecret wvDxjjRQ1tHPiL0oj7Y**** The AccessKey secret of your Alibaba Cloud account or a RAM user within the account. You can obtain the AccessKey secret from the Alibaba Cloud Management Console. For more information, see Obtain an AccessKey pair.
endPoint 1880770****.mq-amqp.cn-hangzhou-a.aliyuncs.com The endpoint that is used to connect to the Message Queue for RabbitMQ instance. You can view the endpoint on the Instances page in the Message Queue for RabbitMQ console. For more information, see View instance details.
instanceId 1880770**** The ID of the Message Queue for RabbitMQ instance. You can view the instance ID on the Instances page in the Message Queue for RabbitMQ console. For more information, see View instance details.
userName N/A The dynamic username that is generated by using Message Queue for RabbitMQ SDKs. Message Queue for RabbitMQ encodes the AccessKey pair of your Alibaba Cloud account or a RAM user within the account and the ID of an Message Queue for RabbitMQ instance in Base64 to obtain a dynamic username. For more information, see the documentation of the SDK for the specified programming language or framework.
passWord N/A The dynamic password that is generated by using Message Queue for RabbitMQ SDKs. Message Queue for RabbitMQ uses the HMAC-SHA1 algorithm to generate a signature based on the AccessKey secret of your Alibaba Cloud account or a RAM user within the account and the timestamp parameter, which indicates the current system time. Then, Message Queue for RabbitMQ encodes the signature and the timestamp parameter in Base64 to obtain a dynamic password. For more information, see the documentation of the SDK for the specified programming language or framework.
virtualHost Test The name of the Message Queue for RabbitMQ vhost. You can view the vhost name on the vhosts page in the Message Queue for RabbitMQ console. For more information, see View vhost details.