Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel interface {
Consume(queue string, consumer string, autoAck bool, exclusive bool, noLocal bool, noWait bool, args amqp.Table) <-chan amqp.Delivery
Cancel(consumer string, noWait bool) error
Close() error
}
Channel is a RabbitMQ channel opened for consuming deliveries.
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer is Consumer for RabbiMQ. Will automatically recreate channel on channel errors. Reconnection is done with exponential backoff.
func NewConsumer ¶
NewConsumer creates new RabbitMQ Consumer. Default configuration will create a durable queue and is ready for competing consumers.
An empty consumer name will cause the library to generate a unique identity. An empty queue name will cause the broker to generate a unique name https://www.rabbitmq.com/queues.html#server-named-queues.
type Option ¶
type Option func(c *consumeCfg)
Option allows to configure RabbitMQ Consumer. Please refer to https://pkg.go.dev/github.com/rabbitmq/amqp091-go?utm_source=godoc#Channel.Consume.
func WithConsumeArgs ¶
WithConsumeArgs sets additional arguments for consuming.
func WithConsumeAutoAck ¶
func WithConsumeAutoAck() Option
WithConsumeAutoAck sets the server to acknowledge deliveries to this consumer prior to writing the delivery to the network.
func WithConsumeExclusive ¶
func WithConsumeExclusive() Option
WithConsumeExclusive sets the server to ensure that this is the sole consumer from this queue.
func WithConsumeNoWait ¶
func WithConsumeNoWait() Option
WithConsumeNoWait sets the server to not wait to confirm the request and immediately begin deliveries.
func WithConsumerTag ¶
WithConsumerTag sets consumer consumerTag. Otherwise, library will generate a unique identity.
type ProcessFunc ¶
ProcessFunc type is an adapter to allow the use of ordinary functions as Processor.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
batch
command
|
|
|
channel
command
|
|
|
connection
command
|
|
|
consumer
command
|
|
|
Package rabbittest provides "stretchr/testify/suite" testing suite with prepared RabbitMQ connection, channel or topology.
|
Package rabbittest provides "stretchr/testify/suite" testing suite with prepared RabbitMQ connection, channel or topology. |