go-mq alternatives and similar packages
Based on the "Messaging" category.
Alternatively, view go-mq alternatives based on common mentions on social networks and blogs.
-
Centrifugo
Scalable real-time messaging server in a language-agnostic way. Set up once and forever. -
machinery
Machinery is an asynchronous task queue/job queue based on distributed message passing. -
NATS Go Client
Golang client for NATS, the cloud native messaging system. -
Confluent Kafka Golang Client
Confluent's Apache Kafka Golang client -
Mercure
An open, easy, fast, reliable and battery-efficient solution for real-time communications -
APNs2
⚡ HTTP/2 Apple Push Notification Service (APNs) push provider for Go — Send push notifications to iOS, tvOS, Safari and OSX apps, using the APNs HTTP/2 protocol. -
Uniqush-Push
Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices. -
Chanify
Chanify is a safe and simple notification tools. This repository is command line tools for Chanify. -
amqp
An AMQP 0-9-1 Go client maintained by the RabbitMQ team. Originally by @streadway: `streadway/amqp` -
mangos
mangos is a pure Golang implementation of nanomsg's "Scalablilty Protocols" -
PingMe
PingMe is a CLI which provides the ability to send messages or alerts to multiple messaging platforms & email. -
emitter
Emits events in Go way, with wildcard, predicates, cancellation possibilities and many other good wins -
Bus
🔊Minimalist message bus implementation for internal communication with zero-allocation magic on Emit -
redisqueue
redisqueue provides a producer and consumer of a queue that uses Redis streams -
drone-line
Sending line notifications using a binary, docker or Drone CI. -
go-events
:mega: Pure nodejs EventEmmiter for the Go Programming Language. -
RapidMQ
RapidMQ is a pure, extremely productive, lightweight and reliable library for managing of the local messages queue -
Ratus
Ratus is a RESTful asynchronous task queue server. It translated concepts of distributed task queues into a set of resources that conform to REST principles and provides a consistent HTTP API for various backends based on embedded or external storage engines. -
go-notify
Package notify provides an implementation of the Gnome DBus Notifications Specification. -
structured pubsub
Publish and subscribe functionality within a single process in Go. -
go-longpoll
Parked: PubSub queuing with long-polling subscribers (not bound to http) -
jazz
Abstraction layer for simple rabbitMQ connection, messaging and administration
Access the most powerful time series database as a service
Do you think we are missing an alternative of go-mq or a related project?
Popular Comparisons
README
About
This package provides an ability to encapsulate creation and configuration of RabbitMQ([AMQP])(https://www.amqp.org) entities like queues, exchanges, producers and consumers in a declarative way with a single config.
Exchanges, queues and producers are going to be initialized in the background.
go-mq supports both sync and async producers.
go-mq has auto reconnects on closed connection or network error.
You can configure delay between each connect try using reconnect_delay
option.
Install
go get -u github.com/cheshir/go-mq
API
Visit godoc to get information about library API.
For those of us who preferred learn something new on practice there is working examples in example
directory.
Configuration
You can configure mq using mq.Config struct directly or by filling it from config file.
Supported configuration tags:
- yaml
- json
- mapstructure
Available options:
dsn: "amqp://login:[email protected]:port/virtual_host"
reconnect_delay: 5s # Interval between connection tries. Check https://golang.org/pkg/time/#ParseDuration for details.
test_mode: false # Switches library to use mocked broker. Defaults to false.
exchanges:
- name: "exchange_name"
type: "direct"
options:
# Available options with default values:
auto_delete: false
durable: false
internal: false
no_wait: false
queues:
- name: "queue_name"
exchange: "exchange_name"
routing_key: "route"
# A set of arguments for the binding.
# The syntax and semantics of these arguments depend on the exchange class.
binding_options:
no_wait: false
# Available options with default values:
options:
auto_delete: false
durable: false
exclusive: false
no_wait: false
producers:
- name: "producer_name"
buffer_size: 10 # Declare how many messages we can buffer during fat messages publishing.
exchange: "exchange_name"
routing_key: "route"
sync: false # Specify whether producer will worked in sync or async mode.
# Available options with default values:
options:
content_type: "application/json"
delivery_mode: 2 # 1 - non persistent, 2 - persistent.
consumers:
- name: "consumer_name"
queue: "queue_name"
workers: 1 # Workers count. Defaults to 1.
prefetch_count: 0 # Prefetch message count per worker.
prefetch_size: 0 # Prefetch message size per worker.
# Available options with default values:
options:
no_ack: false
no_local: false
no_wait: false
exclusive: false
Error handling
All errors are accessible via exported channel:
package main
import (
"log"
"github.com/cheshir/go-mq"
)
func main() {
config := mq.Config{} // Set your configuration.
queue, _ := mq.New(config)
// ...
go handleMQErrors(queue.Error())
// Other logic.
}
func handleMQErrors(errors <-chan error) {
for err := range errors {
log.Println(err)
}
}
If channel is full – new errors will be dropped.
Errors from sync producer won't be accessible from error channel because they returned directly.
Tests
There are some cases that can only be tested with real broker and some cases that can only be tested with mocked broker.
If you are able to run tests with a real broker run them with:
go test -mock-broker=0
Otherwise mock will be used.
Changelog
Check releases page.
How to upgrade
From version 0.x to 1.x
GetConsumer()
method was renamed toConsumer()
. This is done to follow go guideline.GetProducer()
method was removed. Use insteadAsyncProducer()
orSyncProducer()
if you want to catch net error by yourself.
Epilogue
Feel free to create issues with bug reports or your wishes.
*Note that all licence references and agreements mentioned in the go-mq README section above
are relevant to that project's source code only.