Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
Batch consumes messages in batches. Implements rabbitmq.Consumer.
func InBatches ¶
func InBatches(amount int, timeout time.Duration, tx BatchTransaction, rejectRequeue bool, mws ...BatchMiddleware) *Batch
InBatches creates new batch consumer. One batch is `amount` of messages or until timeout, whichever comes first.
type BatchDeliveryHandler ¶
BatchDeliveryHandler specifies how to handle batch of RabbitMQ deliveries. Returns one-to-one errors of processed deliveries.
type BatchMiddleware ¶
type BatchMiddleware func(BatchDeliveryHandler) BatchDeliveryHandler
BatchMiddleware specifies middlewares for processing batch of RabbitMQ deliveries. Could be used for logging, tracing, etc.
type BatchTransaction ¶
BatchTransaction defines process function for handling batch of messages. Batch is a slice of messages, should return slice of one-to-one errors for each message.
type DeliveryHandler ¶
DeliveryHandler specifies how to handle raw RabbitMQ delivery.
type Middleware ¶
type Middleware func(DeliveryHandler) DeliveryHandler
Middleware specifies middlewares for processing RabbitMQ delivery. Could be used for logging, tracing, etc.
type One ¶
type One struct {
// contains filtered or unexported fields
}
One consumes messages one-by-one.
func ByOne ¶
func ByOne(tx Transaction, rejectRequeue bool, mws ...Middleware) *One
ByOne creates new One consumer. It passes message into transaction and automatically ack/reject based on transaction's returned error.