Go simple async message bus

🚌 message-bus

Build Status Go Report Card codecov FOSSA Status license

logo

Go simple async message bus.

📖 ABOUT

Contributors:

Want to contribute ? Feel free to send pull requests!

Have problems, bugs, feature ideas? We are using the github issue tracker to manage them.

📚 Documentation

For documentation (including examples), visit rafallorenz.com/message-bus

For GoDoc reference, visit pkg.go.dev

🚏 HOW TO USE

🚅 Benchmark

➜  message-bus git:(master) ✗ go test -bench=. -cpu=4 -benchmem
goos: darwin
goarch: amd64
pkg: github.com/vardius/message-bus
BenchmarkPublish-4                   	 4430224	       250 ns/op	       0 B/op	       0 allocs/op
BenchmarkSubscribe-4                 	  598240	      2037 ns/op	     735 B/op	       5 allocs/op

👉 Click here to see all benchmark results.

Features

🚏 HOW TO USE

📜 License

This package is released under the MIT license. See the complete license in the package:

FOSSA Status

Comments
  • The website example needs a change to work in playground

    The website example needs a change to work in playground

    The "message-bus" import is eliminated when ran from play.golang.org, as it doesn't match the package name as used by the code. It needs to be aliases, as in https://play.golang.org/p/U5nstd936qf

  • Could you keep the 'v1.0.0' interface?

    Could you keep the 'v1.0.0' interface?

    I like the new interface. Really, I used the semaphore to control concurrency outside the bus. And, I hope to keeps both the old interface and the new interface.

    • There is the code that depends on the old interface.
    • The new interface has a concern as performance is degraded. https://github.com/vardius/message-bus/blob/master/README.md#benchmark

    v1.0.0 https://github.com/vardius/message-bus/blob/c1f01b61c37e8992775c53d6be6b61e362adfce2/bus.go#L82

    v1.1.0 https://github.com/vardius/message-bus/blob/bdb2394d9af1cf4f226490d32a6cb4e8f6d36ab7/bus.go#L93

    Ref: https://github.com/vardius/message-bus/commit/dd40db9f8e8a2cfe434fdc9381202827f851c931#diff-ecf9c6bcdc8d97b7f04226e8857c1108L82

  • Add license scan report and status

    Add license scan report and status

    Your FOSSA integration was successful! Attached in this PR is a badge and license report to track scan status in your README.

    Below are docs for integrating FOSSA license checks into your CI:

  • subscriber process event asyncly

    subscriber process event asyncly

    I merged it https://github.com/vardius/message-bus/pull/6 but have to think about it if this is an improvement or not, it increases allocations number plus if the number of subscribers is high it actually slows down

    before

    BenchmarkPublish-4                   	 5214352	       226 ns/op	       0 B/op	       0 allocs/op
    BenchmarkSubscribe-4                 	  632084	      3319 ns/op	     730 B/op	       5 allocs/op
    Benchmark1Subscriber1Topic-4         	 5545311	       225 ns/op	       0 B/op	       0 allocs/op
    Benchmark1Subscriber100Topics-4      	 2261838	       808 ns/op	       0 B/op	       0 allocs/op
    Benchmark100Subscribers1Topic-4      	   61615	     19539 ns/op	       0 B/op	       0 allocs/op
    Benchmark100Subscribers100Topics-4   	   60561	     34031 ns/op	       0 B/op	       0 allocs/op
    

    after

    BenchmarkPublish-4                   	  598759	      1981 ns/op	       2 B/op	       0 allocs/op
    BenchmarkSubscribe-4                 	 1000000	      4218 ns/op	     725 B/op	       4 allocs/op
    Benchmark1Subscriber1Topic-4         	  629875	      1899 ns/op	      13 B/op	       0 allocs/op
    Benchmark1Subscriber100Topics-4      	  621306	      1935 ns/op	       0 B/op	       0 allocs/op
    Benchmark100Subscribers1Topic-4      	    6942	    206815 ns/op	    3343 B/op	       8 allocs/op
    Benchmark100Subscribers100Topics-4   	    6996	    320923 ns/op	    8107 B/op	      16 allocs/op
    

    Originally posted by @vardius in https://github.com/vardius/message-bus/pull/6#issuecomment-651752332

    Did not release new version yet, will think about it and either revert or release would love to hear second opinion about it.

    	go func() {
     		for args := range h.queue {
    - 			h.callback.Call(args)
    +		 	go func(targs []reflect.Value) {
    + 				h.callback.Call(targs)
    + 			}(args)
     		}
     	}()
    

    Personally I think it is up to a developer of a handler to execute his callback in a goroutine or not, up to him and the package itself should not enforce goroutine here. cc @me020523

  • How does this compare with systems like Kafka and RabbitMQ?

    How does this compare with systems like Kafka and RabbitMQ?

    How does this library compare with the usage of systems like Kafka and RabbitMQ as message transporters? Particularly in terms of performance and security.

    Edit: just took a look at the code, it seems like this library doesn't do what I thought. So is it accurate to say that it's a sync RWMutex wrapper utility? How can one use it to establish connection between microservices, if at all possible?

🔊Minimalist message bus implementation for internal communication

?? Bus Bus is a minimalist event/message bus implementation for internal communication. It is heavily inspired from my event_bus package for Elixir la

Jan 3, 2023
GTA(Go Task Async) is a lightweight reliable asynchronous task and transaction message library for Golang

GTA (Go Task Async) is a lightweight and reliable asynchronous task and transaction message library for by golang.

Jun 4, 2022
Alertmanager go message broker - A simple message broker made to integrate with alertmanager/prometheus

Alertmanager message broker Prerequisites Go 1.16+ Sqllite driver About: The alertmanager message broker is a project made to meet some of my needs to

Dec 27, 2021
Native Go bindings for D-Bus

dbus dbus is a simple library that implements native Go client bindings for the D-Bus message bus system. Features Complete native implementation of t

Dec 30, 2022
Gin best practices, gin development scaffolding, too late to explain, get on the bus.

Table of Contents generated with DocToc gin_scaffold 现在开始 文件分层 log / redis / mysql / http.client 常用方法 swagger文档生成 gin_scaffold Gin best practices, gin

Dec 27, 2022
Easy to use distributed event bus similar to Kafka
Easy to use distributed event bus similar to Kafka

chukcha Easy to use distributed event bus similar to Kafka. The event bus is designed to be used as a persistent intermediate storage buffer for any k

Dec 30, 2022
Govent is an event bus framework for DDD event source implement

Govent is an event bus framework for DDD event source implement. Govent can also solve the package circular dependency problem.

Jan 28, 2022
[Go] Lightweight eventbus with async compatibility for Go

EventBus Package EventBus is the little and lightweight eventbus with async compatibility for GoLang. Installation Make sure that Go is installed on y

Jan 1, 2023
A single binary, simple, message queue.

MiniQueue A stupid simple, single binary message queue using HTTP/2. Most messaging workloads don't require enormous amounts of data, endless features

Nov 9, 2022
Simple docker container to publish a fixed message to a specified queue. Created to be used with k8s CRON scheduling.

RabbitMQ Publish CRON Simple docker container to publish a fixed message to a specified rabbitmq exchange. Created to be used as part of a Kubernetes

Dec 20, 2021
An n:m message multiplexer written in Go
An n:m message multiplexer written in Go

What is Gollum? Gollum is an n:m multiplexer that gathers messages from different sources and broadcasts them to a set of destinations. Gollum origina

Dec 23, 2022
A library for scheduling when to dispatch a message to a channel

gosd go-schedulable-dispatcher (gosd), is a library for scheduling when to dispatch a message to a channel. Implementation The implementation provides

Sep 27, 2022
:incoming_envelope: A fast Message/Event Hub using publish/subscribe pattern with support for topics like* rabbitMQ exchanges for Go applications

Hub ?? A fast enough Event Hub for go applications using publish/subscribe with support patterns on topics like rabbitMQ exchanges. Table of Contents

Dec 17, 2022
Machinery is an asynchronous task queue/job queue based on distributed message passing.
Machinery is an asynchronous task queue/job queue based on distributed message passing.

Machinery Machinery is an asynchronous task queue/job queue based on distributed message passing. V2 Experiment First Steps Configuration Lock Broker

Jan 7, 2023
The Xiaomi message push service is a system-level channel on MIUI and is universal across the platform, which can provide developers with stable, reliable, and efficient push services.

Go-Push-API MiPush、JiPush、UMeng MiPush The Xiaomi message push service is a system-level channel on MIUI and is universal across the platform, which c

Oct 20, 2022
GopherSay allow you to display a message said by a cute random Gopher.

GopherSay About Welcome in GopherSay! GopherSay is inspired by Cowsay program. GopherSay allow you to display a message said by a cute random Gopher.

Nov 23, 2022
Golang module/tool for decoding proto buffer without message definition.
Golang module/tool for decoding proto buffer without message definition.

Golang module/tool for decoding proto buffer without message definition.

Nov 11, 2022
Testing message queues with RabbitMQ

Rabbit-MessageQueue Just a repository of RabbitMQ simple usage for queueing messages. You can use this as a sender or a receiver. More information is

Mar 10, 2022
Distributed Lab 3: Message Broker in Go
Distributed Lab 3: Message Broker in Go

Distributed Lab 3: Message Broker in Go Using the lab sheet There are two ways to use the lab sheet, you can either: create a new repo from this templ

Oct 29, 2021