Skip to content

stanislas-m/amqp-work-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AMQP worker adapter for Buffalo

This package implements the github.com/gobuffalo/buffalo/worker.Worker interface using the github.com/streadway/amqp package.

It allows AMQP-compatible message brokers, such as RabbitMQ, to process Buffalo's background tasks.

Setup

import "github.com/stanislas-m/amqp-work-adapter"
import "github.com/streadway/amqp"

// ...

conn, err := amqp.Dial("amqp://guest:guest@localhost:5672")
if err != nil {
    log.Fatal(err)
}

buffalo.New(buffalo.Options{
  // ...
  Worker: amqpw.New(amqpw.Options{
    Connection: conn,
    Name:           "myapp",
    MaxConcurrency: 25,
  }),
  // ...
})