Documentation
¶
Overview ¶
Package rabbitmq implements the "rabbitmq" protocol.Protocol driver, for load testing a RabbitMQ 3.12 or later broker (and other brokers that speak AMQP 0-9-1). It uses a pure Go client.
A connection holds many light channels, and every call uses exactly one channel. It does not take a second channel while it holds one, so a slow call cannot deadlock the rest. Publish reuses a healthy confirm-mode channel. Consume, roundtrip and admin open a fresh channel and close it, because they leave consumer state behind.
The client library's methods wait for the broker with no deadline of their own. Each call starts a watchdog that closes the channel when the budget ends, and closes the connection if that close does not finish. Run waits for that watchdog before it returns. The next call on the shared connection would otherwise meet a close that is still in progress.
Publishing is allowed without a flag, the same as the other message brokers. Consuming with ack=ack, and the admin actions that change the broker, are not. A RabbitMQ user with limited permissions is the real lock.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Options = []string{
"mode", "exchange", "routing_key", "queue", "bind_key", "count",
"confirm", "mandatory", "persistent", "content_type", "priority",
"expiration", "headers", "ack", "prefetch", "expect", "action",
"durable", "auto_delete", "queue_type", "exchange_type",
"username", "password_env", "vhost", "tls", "connection", "channels",
"heartbeat", "connection_name", "allow_writes", "allow_admin",
}
Options are the -opt keys this driver accepts. The command's protocol table uses the same list, so the two cannot differ.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is a RabbitMQ protocol.Protocol.
func NewConn ¶
NewConn is New for a scenario script. It makes only the connection: the broker, the login and the connection options. It needs no mode. The job of each call is then set with Call. password is the password, which the script already holds, so password_env is not used with it.
func (*Driver) Call ¶
Call returns a Driver for one call of a script: the same connection as d, with the job that opts and body describe. Closing it does nothing. Closing d closes the connection.
func (*Driver) Close ¶
Close implements protocol.Protocol. A Call driver shares the connection and closes nothing.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package rabbitmqtest is a small AMQP 0-9-1 broker for tests.
|
Package rabbitmqtest is a small AMQP 0-9-1 broker for tests. |