https://github.com/xentek/pikaq
Pikaq makes writing your own high performance message-based services fun and type safe.
https://github.com/xentek/pikaq
amqp amqp-client amqp0-9-1 consumer go golang mq rabbitmq
Last synced: 5 months ago
JSON representation
Pikaq makes writing your own high performance message-based services fun and type safe.
- Host: GitHub
- URL: https://github.com/xentek/pikaq
- Owner: xentek
- License: mit
- Created: 2017-07-03T18:48:48.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-04-26T15:23:05.000Z (about 5 years ago)
- Last Synced: 2026-01-14T17:55:22.418Z (6 months ago)
- Topics: amqp, amqp-client, amqp0-9-1, consumer, go, golang, mq, rabbitmq
- Language: Go
- Size: 52.7 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# pikaq [](https://travis-ci.org/xentek/pikaq) [](https://godoc.org/github.com/xentek/pikaq) [](https://goreportcard.com/report/github.com/xentek/pikaq) [](https://github.com/xentek/pikaq/blob/master/LICENSE)

#### __PikaQ, I choose YOU!__
PikaQ makes working with Rabbit MQ _even_ easier. It provides a thin layer around [streadway/amqp](https://github.com/streadway/amqp), the defacto standard golang library for publishing and consuming Rabbit MQ messages. This package makes writing your own high performance message-based services fun and type safe.
> The name "pika" is used for any member of the Ochotonidae, a family within the order of lagomorphs, which also includes the Leporidae (rabbits and hares).
> __-- [Wikipedia](https://en.wikipedia.org/wiki/Pika)__
---
## Install
go get https://github.com/xentek/pikaq
## Import
import "github.com/xentek/pikaq"
## Usage
The simplest consumer you can create just logs and _acks_ each message it recieves. The example below uses the built in `LoggingHandler`.
For your consumer, write a function with the following signature: `func(pikaq.Messages, chan error)`, and pass it as the last argument of `pikaq.LoggingHandler`. Refer to the [examples](_examples) for more information.
```golang
package main
import (
"log"
"github.com/xentek/pikaq"
)
func main() {
c, err := pikaq.NewConsumer("amqp://localhost:5672", "amq.direct", "direct", "example-queue", "routing-key", "example", pikaq.LoggingHandler)
if err != nil {
log.Fatalf("New Consumer Error: %s", err)
}
log.Printf("Started Consumer: %s", c.tag.Tag())
}
```
## Contributing
Refer to our [Contributor's Guide](CONTRIBUTING.md) to learn how you can participate in this project.
## More Info
- [GoDoc](https://godoc.org/github.com/xentek/pikaq)
- [Wiki](https://github.com/xentek/pikaq/wiki)
- [Examples](_examples)