Skip to content

DearMadMan/amqpretry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Overview

diagram

Install

go get -u github.com/DearMadMan/amqpretry

Usage

op := amqpretry.Option{
    DNS: "amqp://dev:dev@localhost:15666",
    DeliverQueue: "deliver_queue",
    FailureQueue: "deliver_failure_queue",
    DeadLetterQueue: "deliver_dead_letter_queue",
    DeadLetterExchange: "dead_letter_exchange",
    InitQueueAndExchange: true,
    Runnable:  func(d *amqp.Delivery, retry *amqpretry.AMQPRetry) error {
        // no need to 'ack' or 'nack' messages
        // message will retry when error returned and policy allowed

        return nil
    }, 
}

retry, err := amqpretry.New(op)
if err != nil {
    log.Fatal(err)
}

retry.Start()

Reference

lanetix/node-amqplib-retry

Feature

  • OnAckError
  • AfterAck
  • ErrorHeader
  • Rabbitmq lazy mode header support
  • Message Qos