All Projects → asim → Mq

asim / Mq

Licence: apache-2.0
MQ is a simple distributed in-memory message broker

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Mq

Qmq
QMQ是去哪儿网内部广泛使用的消息中间件,自2012年诞生以来在去哪儿网所有业务场景中广泛的应用,包括跟交易息息相关的订单场景; 也包括报价搜索等高吞吐量场景。
Stars: ✭ 2,420 (+2022.81%)
Mutual labels:  message-queue, message-bus
go-nats-examples
Single repository for go-nats example code. This includes all documentation examples and any common message pattern examples.
Stars: ✭ 99 (-13.16%)
Mutual labels:  message-bus, message-queue
Phpnats
A PHP client for the NATSio cloud messaging system.
Stars: ✭ 209 (+83.33%)
Mutual labels:  message-queue, message-bus
Enqueue Dev
Message Queue, Job Queue, Broadcasting, WebSockets packages for PHP, Symfony, Laravel, Magento. DEVELOPMENT REPOSITORY - provided by Forma-Pro
Stars: ✭ 1,977 (+1634.21%)
Mutual labels:  message-queue, message-bus
Nats Server
High-Performance server for NATS.io, the cloud and edge native messaging system.
Stars: ✭ 10,223 (+8867.54%)
Mutual labels:  message-queue, message-bus
Message Bus
Go simple async message bus
Stars: ✭ 166 (+45.61%)
Mutual labels:  message-queue, message-bus
Enqueue Bundle
[READ-ONLY] Message queue bundle for Symfony. RabbitMQ, Amazon SQS, Redis, Service bus, Async events, RPC over MQ and a lot more
Stars: ✭ 233 (+104.39%)
Mutual labels:  message-queue, message-bus
Nats.c
A C client for NATS
Stars: ✭ 220 (+92.98%)
Mutual labels:  message-queue, message-bus
telephone-ts
Telephone-ts: The "Event Emitter-less" TypeScript Event Architecture.
Stars: ✭ 22 (-80.7%)
Mutual labels:  message-bus, message-queue
psr-container-messenger
Message bus and queue for Mezzio with Symfony Messenger + Enqueue
Stars: ✭ 24 (-78.95%)
Mutual labels:  message-bus, message-queue
Rxmq.js
JavaScript pub/sub library based on RxJS
Stars: ✭ 134 (+17.54%)
Mutual labels:  message-queue, message-bus
Benthos
Fancy stream processing made operationally mundane
Stars: ✭ 3,705 (+3150%)
Mutual labels:  message-queue, message-bus
Rebus
🚌 Simple and lean service bus implementation for .NET
Stars: ✭ 1,733 (+1420.18%)
Mutual labels:  message-queue, message-bus
Hangfire.topshelf
Best practice for hangfire samples
Stars: ✭ 192 (+68.42%)
Mutual labels:  message-queue, message-bus
grails-rabbitmq-native
A Grails plugin that provides convenient RabbitMQ functionality using the native Java library for RabbitMQ.
Stars: ✭ 27 (-76.32%)
Mutual labels:  message-bus, message-queue
OpenSleigh
OpenSleigh is a Saga management library for .NET Core.
Stars: ✭ 198 (+73.68%)
Mutual labels:  message-bus, message-queue
Plumber
A swiss army knife CLI tool for interacting with Kafka, RabbitMQ and other messaging systems.
Stars: ✭ 514 (+350.88%)
Mutual labels:  message-queue, message-bus
Lemon Rabbitmq
乐檬框架之rabbitMQ的解耦实现方式(基于springboot框架),利用ConfirmCallback确保消息安全发送至broker服务器,使用Ack/Nack手动确认消息处理状态,保证broker消息被正确消费
Stars: ✭ 46 (-59.65%)
Mutual labels:  message-queue
So 5 5
SObjectizer: it's all about in-process message dispatching!
Stars: ✭ 87 (-23.68%)
Mutual labels:  message-queue
Enqueue Elastica Bundle
The bundle extends functionality of FOSElasticaBundle. Improves performance of fos:elastica:populate command
Stars: ✭ 40 (-64.91%)
Mutual labels:  message-queue

MQ License Travis CI Go Report Card

MQ is a simple distributed in-memory message broker

Features

  • In-memory message queue
  • HTTP or gRPC transport
  • Clustering
  • Sharding
  • Proxying
  • Discovery
  • Auto retries
  • TLS support
  • Command line client
  • Interactive client
  • Go client
  • Persist to file

MQ generates a self signed certificate by default if no TLS config is specified

API

Publish

/pub?topic=string	publish payload as body

Subscribe

/sub?topic=string	subscribe as websocket

Architecture

  • MQ servers are standalone servers with in-memory queues and provide a HTTP API
  • MQ clients shard or cluster MQ servers by publish/subscribing to one or all servers
  • MQ proxies use the go client to cluster MQ servers and provide a unified HTTP API

Because of this simplistic architecture, proxies and servers can be chained to build message pipelines

Usage

Install

go get github.com/asim/mq

Or

docker pull chuhnk/mq

Run Server

Listens on *:8081

mq

Set server address

mq --address=localhost:9091

Enable TLS

mq --cert_file=cert.pem --key_file=key.pem

Persist to file per topic

mq --persist

Use gRPC transport

mq --transport=grpc

Run Proxy

MQ can be run as a proxy which includes clustering, sharding and auto retry features.

Clustering: Publish and subscribe to all MQ servers

mq --proxy --servers=10.0.0.1:8081,10.0.0.1:8082,10.0.0.1:8083

Sharding: Requests are sent to a single server based on topic

mq --proxy --servers=10.0.0.1:8081,10.0.0.1:8082,10.0.0.1:8083 --select=shard

Resolver: Use a name resolver rather than specifying server ips

mq --proxy --resolver=dns --servers=mq.proxy.dev

Run Client

Publish

echo "A completely arbitrary message" | mq --client --topic=foo --publish --servers=localhost:8081

Subscribe

mq --client --topic=foo --subscribe --servers=localhost:8081

Interactive mode

mq -i --topic=foo

Publish

Publish via HTTP

curl -k -d "A completely arbitrary message" "https://localhost:8081/pub?topic=foo"

Subscribe

Subscribe via websockets

curl -k -i -N -H "Connection: Upgrade" \
	-H "Upgrade: websocket" \
	-H "Host: localhost:8081" \
	-H "Origin:http://localhost:8081" \
	-H "Sec-Websocket-Version: 13" \
	-H "Sec-Websocket-Key: MQ" \
	"https://localhost:8081/sub?topic=foo"

Go Client GoDoc

MQ provides a simple go client

import "github.com/asim/mq/go/client"

Publish

// publish to topic foo
err := client.Publish("foo", []byte(`bar`))

Subscribe

// subscribe to topic foo
ch, err := client.Subscribe("foo")
if err != nil {
	return
}

data := <-ch

New Client

// defaults to MQ server localhost:8081
c := client.New()

gRPC client

import "github.com/asim/mq/go/client/grpc"

c := grpc.New()

Clustering

Clustering is supported on the client side. Publish/Subscribe operations are performed against all servers.

c := client.New(
	client.WithServers("10.0.0.1:8081", "10.0.0.1:8082", "10.0.0.1:8083"),
)

Sharding

Sharding is supported via client much like gomemcache. Publish/Subscribe operations are performed against a single server.

import "github.com/asim/mq/go/client/selector"

c := client.New(
	client.WithServers("10.0.0.1:8081", "10.0.0.1:8082", "10.0.0.1:8083"),
	client.WithSelector(new(selector.Shard)),
)

Resolver

A name resolver can be used to discover the ip addresses of MQ servers

import "github.com/asim/mq/go/client/resolver"

c := client.New(
	// use the DNS resolver
	client.WithResolver(new(resolver.DNS)),
	// specify DNS name as server
	client.WithServers("mq.proxy.local"),
)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].