This topic describes how to create and delete a static username and password in the Message Queue for RabbitMQ console.

Background information

When you access Message Queue for RabbitMQ from a client, Message Queue for RabbitMQ authenticates your permissions based on your username and password. Message Queue for RabbitMQ allows you to generate usernames and passwords for your client by using the following methods:
  • Dynamic username and password: Use a permission authentication class provided by Alibaba Cloud to generate a pair of dynamic username and password.
  • Static username and password (recommended): Generate a pair of static username and password in the Message Queue for RabbitMQ console. This method is the same as that of open source RabbitMQ.
Notice If you use an SDK to send or receive messages on your client, we recommend that you use persistent connections. This way, the client does not need to establish connections every time you use the client to send or receive messages. Frequent creation of connections consumes a large number of network and broker resources and may even trigger protection against SYN flood attacks on the broker. For more information, see Connection.

Precautions

  • The account that you use to log on to the Message Queue for RabbitMQ console is an Alibaba Cloud account or a Resource Access Management (RAM) user that is granted the permissions to view, create, and delete static usernames and passwords. For more information about account permissions and authorization operations, see RAM policies and Grant permissions to RAM users.
  • The instance from which you want to create and delete a static username and password is in the Running state.
  • You can use an AccessKey pair to create only a static username and password in an instance. For more information about how to obtain an AccessKey pair of the Alibaba Cloud account or a RAM user, see Obtain an AccessKey pair.
  • If you want to update an existing username and password, delete the existing username and password. Then, create a username and password.
  • If a static username and password are deleted or the AccessKey pair used to create the static username and password is disabled or deleted, the static username and password become invalid. If a client uses the static username and password to access Message Queue for RabbitMQ, the access request is rejected.

Create a static username and password

  1. Log on to the Message Queue for RabbitMQ console.
  2. In the Resource Distribution section of the Overview page, select the region where your instance is located.
  3. On the Instances page, click the name of your instance.
  4. In the left-side navigation pane, click Static Accounts.
  5. On the Static Accounts page, click Create Username/Password.
  6. In the Create Username/Password panel, configure AccessKey ID and AccessKey Secret. Then, click OK.
    On the Static Accounts page, the static username and password that you created appear. The password is masked. Username and password
  7. In the Password column of the static username and password that you created, click Display to view the password that corresponds to the username.

Delete a static username and password

  1. Log on to the Message Queue for RabbitMQ console.
  2. In the Resource Distribution section of the Overview page, select the region where your instance is located.
  3. On the Instances page, click the name of your instance.
  4. In the left-side navigation pane, click Static Accounts.
  5. On the Static Accounts page, find the static username and password that you want to delete and click Delete in the Actions column.
  6. In the Note message, read the note and click OK.
    The static username and password that you deleted no longer appear on the Static Accounts page.

Related operations

Your client can access Message Queue for RabbitMQ from an open source RabbitMQ client by using the static username and password that you created. For more information, see Supported SDKs.
Note Before you use the AccessKey pair of a RAM user to create a static username and password that are used to access Message Queue for RabbitMQ to send and receive messages, make sure that the RAM user is granted the required permissions to send and receive messages. For more information, see RAM policies.