rabbitmq

package
v0.17.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package rabbitmq is the RabbitMQ engine of `komando queue` (AMQP 0-9-1, through github.com/rabbitmq/amqp091-go). It registers itself with queuex for amqp:// and amqps:// conns. Reading never removes a message: peek takes messages from the front of a queue and gives them back. ls, info and describe also use the management HTTP API when the URL names its port (?management=15672). See docs/features/queues.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(ctx context.Context, t driver.Target, password string, dial queuex.DialFunc, timeout time.Duration, clientID string) (queuex.Queue, error)

Open logs in to the conn's vhost through dial (direct, --via an SSH server, or a VPN), with TLS on top for amqps://.

Types

type Rabbit

type Rabbit struct {
	// contains filtered or unexported fields
}

Rabbit is a queuex.Queue on one virtual host of a RabbitMQ server.

func (*Rabbit) Close

func (r *Rabbit) Close()

Close ends the connection; messages a peek still held go back to their queue then, as RabbitMQ does for every closed connection.

func (*Rabbit) Create

func (r *Rabbit) Create(ctx context.Context, s queuex.TopicSpec, dryRun bool) (*queuex.Created, error)

Create declares a durable queue. RabbitMQ would answer a second declare of the same queue with "ok", so komando checks first and says QUEUE_EXISTS. A dry run checks the name and the settings komando knows, and makes nothing: RabbitMQ cannot check a queue without making it.

func (*Rabbit) Delete

func (r *Rabbit) Delete(ctx context.Context, queues []string, dryRun bool) ([]queuex.Deleted, error)

Delete deletes queues and the messages in them; their consumers are cancelled. Every name must exist; with dry run it only says what each holds.

func (*Rabbit) Describe

func (r *Rabbit) Describe(ctx context.Context, name string) (*queuex.TopicDetail, error)

Describe reads one queue: with the management API all of it, otherwise what a passive queue.declare tells (ready messages and consumers).

func (*Rabbit) Groups

func (r *Rabbit) Groups(context.Context) ([]queuex.Group, error)

Groups: RabbitMQ has no consumer groups.

func (*Rabbit) Info

func (r *Rabbit) Info(ctx context.Context) (*queuex.Info, error)

Info is the server's own words (product, version, cluster name) from the AMQP login, and with the management API its nodes and totals.

func (*Rabbit) Lag

Lag: RabbitMQ has no consumer groups.

func (*Rabbit) Peek

Peek takes up to o.Limit messages from the front of the queue with basic.get, without acknowledging them, and gives them all back (nack with requeue): nothing is removed. RabbitMQ then marks them redelivered, and while peek holds them (a moment) no consumer gets them. If the connection drops in between, RabbitMQ puts them back by itself.

A quorum queue counts every return as a delivery (x-delivery-count) and drops or dead-letters a message after its delivery limit (20 by default since RabbitMQ 4.0). So peek stops with DELIVERY_LIMIT_NEAR once a message it showed has fewer than keepDeliveries deliveries left.

func (*Rabbit) Purge

func (r *Rabbit) Purge(ctx context.Context, queue string, dryRun bool) (*queuex.Purged, error)

Purge deletes the messages waiting in a queue (ready) and keeps the queue. Messages a consumer holds and has not acknowledged stay.

func (*Rabbit) Send

func (r *Rabbit) Send(ctx context.Context, m queuex.Message, dryRun bool) (*queuex.Sent, error)

Send publishes one message to a queue through the default exchange (the routing key is the queue's name) and waits for the server's confirm. The message is persistent, so a durable queue keeps it over a restart.

func (*Rabbit) Topics

func (r *Rabbit) Topics(ctx context.Context, pattern string, internal bool, limit int) ([]queuex.Topic, error)

Topics lists the vhost's queues whose name matches pattern; it needs the management API. RabbitMQ has no internal queues to hide.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL