Updated on 2023-07-20 GMT+08:00

Overview

This guide describes how to collect the information required for connecting to a RabbitMQ instance, such as the instance connection address, port, and public network access information. It also provides connection examples in Python.

RabbitMQ instances are compatible with the open-source RabbitMQ protocol. To access and use a RabbitMQ instance in languages other than Python, see the tutorials at https://www.rabbitmq.com/getstarted.html.

Network Environment of the Client

A client can access a RabbitMQ instance in any of the following modes:

  1. Within a Virtual Private Network (VPC)

    If the client runs on an Elastic Cloud Server (ECS) and is in the same region and VPC as the RabbitMQ instance, the client can access the instance using an IP address within a subnet in the VPC.

  2. Using a VPC peering connection

    If the client runs on an ECS and is in the same region but not the same VPC as the RabbitMQ instance, the client can access the instance using an IP address within a subnet in the VPC of the RabbitMQ instance after a VPC peering connection has been established.

    For details, see VPC Peering Connection.

  3. Over public networks

    If the client is not in the same network environment or region as the RabbitMQ instance, the client can access the instance using its public network IP address.

The three modes differ only in the connection address used by the client to access the instance. This document takes intra-VPC access as an example to describe how to set up the development environment.

If the connection times out or fails, check the network connectivity. You can use Telnet to check the connection address and port number of the instance.

Obtaining Instance Connection Information

  • Instance connection address and port

    After an instance is created, obtain its connection address from the Connection area on the Basic Information page.

    Figure 1 Viewing the connection address and port a RabbitMQ instance
  • Username and password for accessing an instance

    After an instance is created, obtain the username for connecting to it from the Connection area on the Basic Information page. If you have forgotten the password, click Reset Password.