All Projects → zerofox-oss → go-msg

zerofox-oss / go-msg

Licence: BSD-3-Clause-Clear license
Pub/Sub Message Primitives for Go

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Labels

Projects that are alternatives of or similar to go-msg

pubsub cli
super handy google cloud Pub/Sub CLI
Stars: ✭ 32 (-27.27%)
Mutual labels:  pubsub
hub
📨 A fast Message/Event Hub using publish/subscribe pattern with support for topics like* rabbitMQ exchanges for Go applications
Stars: ✭ 125 (+184.09%)
Mutual labels:  pubsub
notification
OST Notification helps publish critical events for cross platform communications
Stars: ✭ 20 (-54.55%)
Mutual labels:  pubsub
pulsar-io-kafka
Pulsar IO Kafka Connector
Stars: ✭ 24 (-45.45%)
Mutual labels:  pubsub
uorb
C++ inter-thread publish/subscribe middleware ported from PX4 and redesigned based on POSIX
Stars: ✭ 35 (-20.45%)
Mutual labels:  pubsub
portara-website
Portara dashboard controller to change rate limit settings without redeploying your app
Stars: ✭ 42 (-4.55%)
Mutual labels:  pubsub
ipfs-pubsub-chatroom
Simple IPFS Pubsub chatroom built on React
Stars: ✭ 45 (+2.27%)
Mutual labels:  pubsub
workers-pubsub
Google Pub/Sub API for Cloudflare Workers (and Node.js)
Stars: ✭ 25 (-43.18%)
Mutual labels:  pubsub
lila-ws
Lichess' websocket server
Stars: ✭ 99 (+125%)
Mutual labels:  pubsub
fastapi websocket pubsub
A fast and durable Pub/Sub channel over Websockets. FastAPI + WebSockets + PubSub == ⚡ 💪 ❤️
Stars: ✭ 255 (+479.55%)
Mutual labels:  pubsub
gobroker
golang wrapper for all (to-be) kinds of message brokers
Stars: ✭ 15 (-65.91%)
Mutual labels:  pubsub
dead-simple
💀💡 Dead simple PubSub and EventEmitter in JavaScript
Stars: ✭ 21 (-52.27%)
Mutual labels:  pubsub
network-monorepo
Monorepo containing all the main components of Streamr Network.
Stars: ✭ 223 (+406.82%)
Mutual labels:  pubsub
angular-PubSub
Angular 1.x implementation of the Publish–Subscribe pattern.
Stars: ✭ 32 (-27.27%)
Mutual labels:  pubsub
payload
A javascript single page application (SPA) driver for REST API payload management.
Stars: ✭ 16 (-63.64%)
Mutual labels:  pubsub
twitch api2
Rust library for talking with the Twitch API aka. "Helix", TMI and more! Use Twitch endpoints fearlessly!
Stars: ✭ 91 (+106.82%)
Mutual labels:  pubsub
webfunc
Universal Serverless Web Framework. Write Express apps ready to be deployed to Zeit-Now, Google Cloud Functions (incl. functions reacting to Pub/Sub topics or Storage changes), and AWS Lambdas.
Stars: ✭ 71 (+61.36%)
Mutual labels:  pubsub
dry-events
Pub/sub system
Stars: ✭ 102 (+131.82%)
Mutual labels:  pubsub
websub-hub
A WebSub Hub implementation in Node.js
Stars: ✭ 44 (+0%)
Mutual labels:  pubsub
smartacus-mqtt-broker
smartacus-mqtt-broker is a Java-based open source MQTT broker that fully supports MQTT 3.x .Using Netty 4.1.37
Stars: ✭ 25 (-43.18%)
Mutual labels:  pubsub

go-msg

GoDoc Build Status

Pub/Sub Message Primitives for Go

This library contains the basic primitives for developing pub-sub systems.

Messages are published to Topics. Servers subscribe to Messages.

These primitives specify abstract behavior of pub-sub; they do not specify implementation. A Message could exist in an in-memory array, a file, a key/value store like RabbitMQ, or even something like Amazon SNS/SQS or Google Pub/Sub. In order to tap into that backend, a concrete implementation must be written for it.

Here's a list of backends that are currently supported:

Backend Link
Channels https://github.com/zerofox-oss/go-msg/backends/mem
AWS (SNS,SQS) https://github.com/zerofox-oss/go-aws-msg
Google PubSub https://github.com/paultyng/go-msg-pubsub

How it works

Backend

A backend simply represents the infrastructure behind a pub-sub system. This is where Messages live.

Examples could include a key/value store, Google Pub/Sub, or Amazon SNS + SQS.

Message

A Message represents a discrete unit of data. It contains a body and a list of attributes. Attributes can be used to distinguish unique properties of a Message, including how to read the body. More on that in decorator patterns.

Publish

A Message is published to a Topic. A Topic writes the body and attributes of a Message to a backend using a MessageWriter. A MessageWriter may only be used for one Message, much like a net/http ResponseWriter

When the MessageWriter is closed, the data that was written to it will be published to that backend and it will no longer be able to be used.

Subscribe

A Server subscribes to Messages from a backend. It's important to note that a Server must know how to convert raw data to a Message - this will be unique to each backend. For example, the way you read message attributes from a file is very different from how you read them from SQS. A Server is always live, so it will continue to block indefinitely while it is waiting for messages until it is shut down.

When a Message is created, the Server passes it to a Receiver for processing. This is similar to how net/http Handler works. A Receiver may return an error if it was unable to process the Message. This will indicate to the Server that the Message must be retried. The specifics to this retry logic will be specific to each backend.

Benefits

This library was originally conceived because we needed a way to reduce copy-pasted code across our pub-sub systems and we wanted to try out other infrastructures.

These primitives allow us to achieve both of those goals. Want to try out Kafka instead of AWS? No problem! Just write a library that utilizes these primitives and the Kafka SDK.

What these primitives or any implementation of these primitives DO NOT DO is mask or replace all of the functionality of all infrastructures. If you want to use a particular feature of AWS that does not fit with these primitives, that's OK. It might make sense to add that feature to the primitives, it might not. We encourage you to open an issue to discuss such additions.

Aside from the code re-use benefits, there's a number of other features which we believe are useful, including:

  • Concrete implementations can be written once and distributed as libraries.

  • Decorator Patterns.

  • Built-in concurrency controls into Server.

  • Context deadlines and cancellations. This allows for clean shutdowns to prevent data loss.

  • Transaction-based Receivers.

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].