Skip to content
This repository has been archived by the owner on Apr 14, 2022. It is now read-only.
/ go-astiamqp Public archive
forked from asticode/go-astiamqp

Wrapper on top of amqp to provide proper configuration and error handling

License

Notifications You must be signed in to change notification settings

MolotovTv/go-astiamqp

 
 

Repository files navigation

Astiamqp

Wrapper on top of amqp to provide proper configuration and error handling

Usage

// Create
a := astiamqp.New(c)
defer a.Close()

// Init
a.Init(context.Background())

// Add producer
p, _ := a.AddProducer(astiamqp.ConfigurationProducer{
    Exchange: astiamqp.ConfigurationExchange{
        Durable: true,
        Name:    "my-exchange",
        Type:    astiamqp.ExchangeTypeTopic,
    },
})

// Publish
p.Publish("my payload", "my.routing.key")

// Add consumer
a.AddConsumer(astiamqp.ConfigurationConsumer{
    AutoAck: false,
    Exchange: astiamqp.ConfigurationExchange{
        Durable: true,
        Name:    "my-exchange",
        Type:    astiamqp.ExchangeTypeTopic,
    },
    Handler: myHandler,
    Queue: astiamqp.ConfigurationQueue{
        Durable: true,
        Name:    "my-queue",
    },
    RoutingKey: "my.routing.key",
})

// Stop
a.Stop()

About

Wrapper on top of amqp to provide proper configuration and error handling

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%