Updated on 2024-10-25 GMT+08:00

RabbitMQ Network Connection Requirements

A client can connect to a RabbitMQ instance in public or private networks. Notes before using a private network:

  • By default, a client and a RabbitMQ instance are interconnected when they are deployed in a VPC.
  • If they are not, you need to interconnect them because of isolation among VPCs.
Table 1 Connection modes

Mode

How To Do

Reference

Public access

Enable public access on the RabbitMQ console and configure elastic IPs (EIPs). The client can connect to the RabbitMQ instance through EIPs.

Configuring RabbitMQ Public Access

Private access

By default, a client and a RabbitMQ instance are interconnected when they are deployed in a VPC.

-

When a client and a RabbitMQ instance are deployed in different VPCs of the same region, interconnect two VPCs using a VPC peering connection.

VPC Peering Connection

Before connecting a client to a RabbitMQ instance, allow accesses for the following security groups.

  • After a security group is created, its default inbound rule allows communication among ECSs within the security group and its default outbound rule allows all outbound traffic. In this case, you can access a RabbitMQ instance within a VPC, and do not need to add rules according to Table 2 or Table 3.
  • The source in Table 2 and Table 3 indicates that all IP segments are allowed. Modify them to your client IP addresses as required.
Table 2 Security group rules (RabbitMQ 3.x.x)

Direction

Type

Protocol

Port

Source

Description

Inbound

IPv4

TCP

5672

0.0.0.0/0

Accessing a RabbitMQ instance at an IPv4 address on a client (without SSL)

Inbound

IPv4

TCP

5671

0.0.0.0/0

Accessing a RabbitMQ instance at an IPv4 address on a client (with SSL)

Inbound

IPv4

TCP

15672

0.0.0.0/0

Accessing the management UI (without SSL)

Inbound

IPv4

TCP

15671

0.0.0.0/0

Accessing the management UI (with SSL)

Table 3 Security group rules (RabbitMQ AMQP-0-9-1)

Direction

Type

Protocol

Port

Source

Description

Inbound

IPv4

TCP

5672

0.0.0.0/0

Accessing a RabbitMQ instance