RapidMQ is a pure, extremely productive, lightweight and reliable library for managing of the local messages queue

Go Report Card Build Status Coverage Status GoDoc

RapidMQ

RapidMQ is a pure, extremely productive, lightweight and reliable library for managing of the local messages queue in the Go programming language.

Installation

go get github.com/sybrexsys/RapidMQ/queue

Requirements

  • Need at least go1.4 or newer.

Usage

Queue

Base structure in the base is Queue Queue is created with that function:

func CreateQueue(Name, StoragePath string, Log Logging, Factory WorkerFactory, Options *Options) (*Queue, error)
Parameters Type Description
Name string Queue name. Used for logging only
StoragePath string Path to the disk storages' files
Log Logging Interface is used to logging of the queue's events. If equal to nil, logging is ensent. Description bellow
Factory WorkerFactory Interface for abstract factory of the workers. Description bellow
Options *Options Options of the queue
func (q *Queue) Insert(buf []byte) bool

Appends the message into the queue. In depends of the timeout's option either is trying to write message to the disk or is trying to process this message in the memory and writing to the disk only if timeout is expired shortly. Returns false if aren't processing / writing of the message in the during of the timeout or has some problems with writing to disk

func (q *Queue) Process(worker WorkerID, isOk bool)

That function must be called from the worker of the message. In depends of the isOk parameter either messages are deleting from the queue or are marking as faulty and again processing after some timeout

func (q *Queue) Count() uint64

Returns the count of the messages in the queue

func (q *Queue) Close()

Stops the handler of the messages, saves the messages located in the memory into the disk, closes all opened files.

Message

Description of the structure that will be sent to worker

type Message struct {
	ID      StorageIdx
	Buffer  []byte
}
Member Type Description
ID StorageIdx ID of the message
Buffer []byte Buffer with content of the message

WorkerFactory

Worker factory is a structure that create workers for processing messages Your factory must support next interface:

type WorkerFactory interface {
	CreateWorker() Worker
	NeedTimeoutProcessing() bool
}
CreateWorker() Worker

Creates new worker for this factory with unique ID

NeedTimeoutProcessing() bool

Returns true if possible used some messages in one action (for example, collect large SQL script from lot of the small messages)

Worker

If you are using of your worker, he must support next interface

type Worker interface {
	ProcessMessage(*Queue, *Message, chan Worker)
	ProcessTimeout(*Queue, chan Worker)
	GetID() WorkerID
	Close()
}
ProcessMessage(*Queue, *Message, chan Worker)

Processes message that is stored in *Message. After it the worker must call function (*Queue).Process with his unique identifier and with result of the processing, also must be pushed himself into chanal Worker

ProcessTimeout(*Queue, chan Worker)

Processing of the event when available messages is absent
After it the worker must call function (*Queue).Process with his unique identifier and with result of the processing, also must send himself into chanal Worker

GetID() WorkerID

Returns unique identifier of the worker

Close() 

Close is called when queue is finishing work with worker. Here you can close connection to database or etc.

Logging

If you are using of your logging system, it must support next interface

type Logging interface {
	Trace(msg string, a ...interface{})
	Info(msg string, a ...interface{})
	Warning(msg string, a ...interface{})
	Error(msg string, a ...interface{})
} 

Author

Vadim Shakun: [email protected]

License

RapidMQ is under the Apache 2.0 license. See the LICENSE file for details.

Similar Resources

Apache Kafka Web UI for exploring messages, consumers, configurations and more with a focus on a good UI & UX.

Apache Kafka Web UI for exploring messages, consumers, configurations and more with a focus on a good UI & UX.

Kowl - Apache Kafka Web UI Kowl (previously known as Kafka Owl) is a web application that helps you to explore messages in your Apache Kafka cluster a

Jan 3, 2023

Korero - Send, recieve and manage messages on multiple platforms

Korero: Send, recieve and manage messages on multiple platforms Korero is a term

Jun 22, 2022

CLI tool for generating random messages with rules & publishing to the cloud services (SQS,SNS,PUB/SUB and etc.)

Randomsg A CLI tool to generate random messages and publish to cloud services like (SQS,SNS,PUB/SUB and etc.). TODO Generation of nested objects is no

Sep 22, 2022

redisqueue provides a producer and consumer of a queue that uses Redis streams

redisqueue redisqueue provides a producer and consumer of a queue that uses Redis streams. Features A Producer struct to make enqueuing messages easy.

Dec 29, 2022

Kudruk helps you to create queue channels and manage them gracefully.

kudruk Channels are widely used as queues. kudruk (means queue in Turkish) helps you to easily create queue with channel and manage the data in the qu

Feb 21, 2022

Chanman helps you to create queue channels and manage them gracefully.

chanman Channels are widely used as queues. chanman (Channel Manager) helps you to easily create queue with channel and manage the data in the queue.

Oct 16, 2021

A basic event queue (and publisher/subscriber) in go

queue A basic event queue (and publisher/subscriber) in go. Installation go get github.com/jimjibone/queue Queue Usage Queue is a channel-based FIFO q

Dec 17, 2021

implentacion queue in kafka, rabbit and sqs

Big Queue on Go This is a simple big queue and implementation in kafka, rabbit and aws sqs. Publish in a topic in kafka: Use NewPublisher method to cr

Dec 29, 2021

graylog-golang is a full implementation for sending messages in GELF (Graylog Extended Log Format) from Go (Golang) to Graylog

graylog-golang is a full implementation for sending messages in GELF (Graylog Extended Log Format) from Go (Golang) to Graylog

Dec 5, 2022
Related tags
Asynq: simple, reliable, and efficient distributed task queue in Go
Asynq: simple, reliable, and efficient distributed task queue in Go

Asynq Overview Asynq is a Go library for queueing tasks and processing them asynchronously with workers. It's backed by Redis and is designed to be sc

Dec 30, 2022
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
A Multi Consumer per Message Queue with persistence and Queue Stages.
 A Multi Consumer per Message Queue with persistence and Queue Stages.

CrimsonQ A Multi Consumer per Message Queue with persistence and Queue Stages. Under Active Development Crimson Queue allows you to have multiple cons

Jul 30, 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
An extremely opinionated TypeScript monorepo tool.

Unirepo Unirepo is an extremely opinionated TypeScript build tool. Typical monorepo management tools in the Node.js ecosystem provide automation aroun

Nov 29, 2022
A lightweight, thread-safe FIFO queue with fixed capacity.

FIFO Queue Thread-safe, lightweight, tested FIFO queue with fixed size, which is built upon list for performance ;-) This implement is inspired by htt

Dec 16, 2021
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
Go client to reliable queues based on Redis Cluster Streams

Ami Go client to reliable queues based on Redis Cluster Streams. Consume/produce performance Performance is dependent from: Redis Cluster nodes count;

Dec 12, 2022
💨A well crafted go packages that help you build robust, reliable, maintainable microservices.

Hippo A Microservices Toolkit. Hippo is a collection of well crafted go packages that help you build robust, reliable, maintainable microservices. It

Aug 11, 2022
Go library for dealing with Ademco and Contact-ID messages

Ademco For Go A lightweight golang library for dealing with Contact-ID and Ademco messaging formats. Installation install via go get $ go get github.c

Jan 11, 2022