Using Management UI
1. Accessing Web Interface
| Step | Description | Details |
|---|---|---|
| 1 | Start RabbitMQ Server | Ensure RabbitMQ is running on the system. The management plugin must be enabled. |
| 2 | Enable Management Plugin (if not already enabled) |
rabbitmq-plugins enable rabbitmq_management
|
| 3 | Find Management UI Port | By default, the management interface runs on port 15672. |
| 4 | Open Web Browser | Navigate to http://localhost:15672 or http://[hostname]:15672. |
| 5 | Log In | Use default credentials guest/guest or custom user credentials if configured. |
Note: The default user
guest has full access to all features. It is recommended to create a dedicated user for production environments.
2. Navigating Overview Tab
| Element | Description | Notes |
|---|---|---|
| Queues | Lists all queues in the RabbitMQ instance | Shows queue names, messages, consumers, and status |
| Exchanges | Lists all exchanges in the RabbitMQ instance | Displays exchange names, types, and bindings |
| Connections | Shows active connections to the broker | Lists connection details like client properties and channels |
| Channels | Displays active channels and their associated connections | Useful for debugging channel-level issues |
| Nodes | Lists all nodes in the cluster (if clustered) | Shows node status, memory usage, and disk space |
| Policies | Lists defined policies and their scope | Policies control queue behavior like TTL or max length |
| Permissions | Shows user permissions for virtual hosts | Helps in managing access control and roles |
Note: The Overview tab provides a centralized view of the entire RabbitMQ instance. It's useful for monitoring and troubleshooting.
3. Managing Connections
| Property | Description | Values |
|---|---|---|
| connection.name | Name of the connection | string |
| connection.user | User who established the connection | string |
| connection.vhost | VHost this connection belongs to | string |
| connection.uptime | How long the connection has been active (in seconds) | number |
| connection.state | Current state of the connection (e.g., running, closing) |
string |
| connection.channels | Number of channels opened over this connection | number |
Note: You can view and manage connections via the RabbitMQ Management UI under the
Connections tab.
4. Managing Channels
| Property | Description | Values |
|---|---|---|
| channel.name | Name of the channel | string |
| channel.id | Unique identifier for the channel | integer |
| channel.connection | Connection associated with the channel | string |
| channel.status | Current status of the channel (open/closed) | string |
Example: Creating a Channel
const amqp = require('amqplib');
async function createChannel() {
const connection = await amqp.connect('amqp://localhost');
const channel = await connection.createChannel();
console.log("Channel created with ID: ", channel.ch);
}
createChannel();
Workflow: Managing Channels via Management UI
- Navigate to the
Channelstab in the Management UI - Select a channel from the list to view its details
- Use the
Closebutton to terminate an active channel - Review channel statistics and messages in real-time
Note: Channels are lightweight and can be created and closed dynamically. They are used to multiplex multiple operations over a single connection.
5. Managing Exchanges
| Property | Description | Values |
|---|---|---|
| name | Exchange name | string |
| type | Exchange type | direct, fanout, topic, headers |
| durable | Persists across broker restarts | true, false |
| auto_delete | Deletes when no longer in use | true, false |
Example: Create a Direct Exchange
const amqp = require('amqplib');
async function createExchange() {
const connection = await amqp.connect('amqp://localhost');
const channel = await connection.createChannel();
await channel.assertExchange('my_direct_exchange', 'direct', {
durable: true,
autoDelete: false
});
console.log('Exchange created');
await channel.close();
await connection.close();
}
createExchange().catch(console.error);
Example: Bind Exchange to Queue
const amqp = require('amqplib');
async function bindExchange() {
const connection = await amqp.connect('amqp://localhost');
const channel = await connection.createChannel();
await channel.bindExchange(
'my_topic_exchange',
'my_direct_exchange',
'routing.key'
);
console.log('Exchange bound');
await channel.close();
await connection.close();
}
bindExchange().catch(console.error);
Note: Exchange types determine how messages are routed.
direct matches routing key exactly, fanout broadcasts to all queues, topic uses pattern matching, and headers matches based on message headers.
Warning: Changing exchange type after creation is not allowed. You must delete and recreate the exchange.
6. Managing Queues
| Property | Value | Description |
|---|---|---|
| name | queue_name |
Name of the queue |
| durable | true | false |
Persists queue across broker restarts |
| auto_delete | true | false |
Deletes queue when no consumers left |
| exclusive | true | false |
Only accessible by the connection that created it |
| arguments | {} |
Additional queue arguments (e.g., maxLength, maxAge) |
Example: Create a durable queue with TTL
const queueOptions = {
durable: true,
arguments: {
'x-message-ttl': 30000,
'x-dead-letter-exchange': 'dlx_exchange'
}
};
Example: Delete a queue
curl -u guest:guest -X DELETE http://localhost:15672/api/queues/%2f/my_queue
Note: Queues created via the UI are not automatically deleted when the broker restarts unless marked as durable.
7. Viewing Bindings
| Binding | Source | Destination | Properties |
|---|---|---|---|
| queue.binding | my-queue |
my-exchange |
Routing key: routing.key |
| exchange.binding | direct-exchange |
fanout-exchange |
Routing key: # |
Example: Binding a Queue to an Exchange
const amqp = require('amqplib');
async function bindQueue() {
const connection = await amqp.connect('amqp://localhost');
const channel = await connection.createChannel();
const queue = 'my-queue';
const exchange = 'my-exchange';
const routingKey = 'routing.key';
await channel.assertQueue(queue);
await channel.assertExchange(exchange, 'direct');
// Bind queue to exchange with routing key
await channel.bindQueue(queue, exchange, routingKey);
console.log('Queue bound to exchange');
await channel.close();
await connection.close();
}
bindQueue().catch(console.error);
Note: Bindings in RabbitMQ define how messages are routed from exchanges to queues. Each binding includes a routing key that determines which messages are delivered to which queue.
8. Publishing Test Messages
Example: Publish a test message via Management UI
1. Navigate to the "Queues" tab
2. Select a queue (e.g., "my-queue")
3. Click the "Publish" button
4. Enter message content in the payload field
5. Optionally set headers or properties
6. Click "Publish" to send the message
| Field | Description | Example Value |
|---|---|---|
| Payload | Message body content (JSON, text, or binary) | {"message": "Hello World"} |
| Headers | Optional key-value pairs for message metadata | {"content-type": "application/json"} |
| Properties | Standard AMQP properties (delivery mode, priority) | {"delivery_mode": 2} |
Note: Messages published via the UI are not persisted unless the queue is durable and the message is marked as persistent.
9. Consuming Test Messages
Example: Consume a test message from a queue
curl -u guest:guest -X GET "http://localhost:15672/api/queues/%2f/test-queue/get" \
-H "Content-Type: application/json" \
-d '{
"count": 1,
"ackmode": "ack_requeue_false",
"encoding": "auto"
}'
| Field | Description | Values |
|---|---|---|
| count | Number of messages to retrieve | 1 |
| ackmode | How to handle message acknowledgment | ack_requeue_false, ack_requeue_true, none |
| encoding | Encoding type for message content | auto, string, base64 |
Note: Ensure the queue exists and has messages before consuming.
Warning: Consuming messages with
ack_requeue_false removes them from the queue permanently.
10. Monitoring Metrics
| Metric | Description | Unit | Source |
|---|---|---|---|
| messages_published | Total number of messages published to the broker | count | Broker |
| messages_delivered | Total number of messages delivered to consumers | count | Broker |
| messages_acknowledged | Total number of messages acknowledged by consumers | count | Broker |
| messages_unacknowledged | Total number of messages not yet acknowledged by consumers | count | Broker |
| queue_messages | Number of messages currently in a queue | count | Queue |
| queue_messages_ready | Number of messages ready to be delivered to consumers | count | Queue |
| queue_messages_unacknowledged | Number of messages not yet acknowledged by consumers | count | Queue |
| connections | Number of active connections to the broker | count | Broker |
| channels | Number of active channels | count | Broker |
| consumers | Number of active consumers | count | Broker |
Example: Viewing Metrics in Management UI
1. Navigate to http://localhost:15672
2. Log in with default credentials (guest/guest)
3. Click on "Overview" tab
4. View real-time metrics in the dashboard
Note: Metrics are updated in real-time and can be filtered by virtual host or queue.
Warning: High message rates can impact broker performance. Monitor regularly.
11. Managing Users and vhosts
| Property | Value | Description |
|---|---|---|
| username | admin |
Administrator username for the management UI |
| password | ******** |
Password for the user account |
| tags | administrator |
User roles and permissions (e.g., administrator, monitoring) |
Example: Creating a New User
curl -u admin:password -H "Content-Type: application/json" \
-X PUT http://localhost:15672/api/users/testuser \
-d '{"password":"testpass","tags":"monitoring"}'
Example: Creating a New Virtual Host
curl -u admin:password -H "Content-Type: application/json" \
-X PUT http://localhost:15672/api/vhosts/testvhost
Example: Setting Permissions for a User in a vhost
curl -u admin:password -H "Content-Type: application/json" \
-X PUT http://localhost:15672/api/permissions/testvhost/testuser \
-d '{"configure":".*","read":".*","write":".*"}'
Note: Ensure that the
management_ui plugin is enabled to access the RabbitMQ Management UI.
Warning: The default
admin user should not be used in production environments without changing the password.
| vhost Name | Permissions | Notes |
|---|---|---|
/ |
administrator |
Default vhost with full access |
testvhost |
monitoring |
Custom vhost for testing or isolated environments |
12. Importing/Exporting Definitions
| Option | Values | Description |
|---|---|---|
| --format | json |
Output format for definitions (default: json) |
| --include | all, definitions, permissions |
Include specific types of definitions (default: all) |
| Option | Values | Description |
|---|---|---|
| --merge | true, false |
Merge imported definitions with existing ones (default: false) |
| --force | true, false |
Overwrite existing definitions (default: false) |
Note: Definitions exported from one RabbitMQ version may not be compatible with another. Always test imports in a non-production environment.