rabbitmq-streams
Manage RabbitMQ streams
TLDR
Add a stream replica on the specified node
Delete a stream replica on the specified node
Display the status of a stream
Restart a stream
List stream connections
List all stream consumers
List all stream publishers
List tracking information for a stream
SYNOPSIS
rabbitmq-streams subcommand [options] [arguments]
PARAMETERS
create <stream-name> [options]
Creates a new stream with the specified name. Optional configurations like --max-length, --max-age, or --max-segment-size can be applied during creation.
delete <stream-name>
Deletes an existing stream and irrevocably removes all its associated messages and metadata.
list
Lists all streams currently configured on the RabbitMQ broker, displaying their names, statuses, and basic properties.
purge <stream-name>
Removes all messages from a stream, effectively clearing its content while leaving the stream resource itself intact.
set-retention <stream-name> [options]
Configures retention policies for a specific stream. Options include --max-age <duration> (e.g., 1h, 7d) or --max-length <bytes> to control message expiration.
set-max-segment-size <stream-name> <size>
Sets the maximum segment file size for a stream (e.g., 100MB, 1GB). Segments are the underlying disk storage units for stream data.
status [stream-name]
Displays the operational status and detailed configuration of a specific stream or all streams if no name is provided.
node <node-name>
Specifies the target RabbitMQ node to connect to when performing operations, particularly useful in clustered environments to direct commands to a specific instance.
--help
Displays help information for the main command or a specific subcommand, showing available options and usage examples.
DESCRIPTION
The rabbitmq-streams command-line interface (CLI) tool is designed for interacting with and managing RabbitMQ Streams. RabbitMQ Streams represent a high-throughput, low-latency, and persistent messaging feature within RabbitMQ, offering a robust solution for scenarios demanding large, ordered event logs.
This utility empowers administrators and developers to perform essential operations directly on the RabbitMQ server, including the creation, deletion, listing, and configuration of streams. It is crucial for the complete lifecycle management of stream resources and for monitoring their status without exclusive reliance on client libraries or the RabbitMQ Management UI. Typically, rabbitmq-streams is distributed as part of the RabbitMQ server utilities, providing a direct and powerful means to control this advanced messaging capability.
CAVEATS
For rabbitmq-streams to function, a running RabbitMQ server with the rabbitmq_stream plugin enabled is mandatory.
Operations performed via this CLI tool are direct server-side commands; they carry significant impact and should be exercised with extreme caution, especially in production environments, as they can lead to data modification or loss.
The tool's functionality is subject to RabbitMQ's authentication and authorization mechanisms, requiring appropriate user permissions.
The exact syntax, available subcommands, and options may exhibit slight variations across different RabbitMQ server versions.
STREAMS PLUGIN REQUIREMENT
The fundamental prerequisite for using rabbitmq-streams is the activation of the rabbitmq_stream plugin on your RabbitMQ server. This can be achieved by running the command: rabbitmq-plugins enable rabbitmq_stream.
DATA STORAGE MECHANISM
RabbitMQ Streams utilize an optimized, disk-backed storage mechanism, segmenting data into immutable files. This design ensures high performance for both writes and reads, guaranteeing persistence and efficient historical data replay. Understanding these underlying storage segments is vital for effective capacity planning, performance tuning, and troubleshooting.
CLIENT INTERACTION
While rabbitmq-streams manages server-side stream resources, the actual publishing and consuming of messages to and from streams are primarily handled by dedicated client libraries. These libraries (available for languages like Java, .NET, etc.) implement the AMQP 1.0-based Stream Protocol, providing the necessary APIs for application-level interaction with streams.
HISTORY
RabbitMQ Streams was introduced as a pivotal feature in RabbitMQ 3.9.0, marking a significant evolution in its messaging capabilities. This development aimed to provide a high-performance, disk-backed messaging system specifically designed for handling very large, immutable event logs. It addresses critical use cases such as event sourcing, IoT data ingestion, and log aggregation, offering robust persistence, ordered message delivery, and efficient replayability, distinguishing itself from traditional RabbitMQ queues.
The rabbitmq-streams command-line utility was developed concurrently with the Streams plugin. Its purpose is to equip administrators with a powerful, direct interface for managing and configuring these new stream resources from the command line, thereby complementing the RabbitMQ Management UI and the various client libraries.
SEE ALSO
rabbitmqctl(1), rabbitmq-plugins(1), systemctl(1), nc(1)


