SkillAgentSearch skills...

Raithe

Lightweight Simple Messaging Queue

Install / Use

/learn @catmullet/Raithe

README

Raithe Maintainability Go Report Card GoDoc

The Compact and Persistent Messaging Queue

Getting Started

Run Go Get

go get github.com/catmullet/Raithe

Modifying your env file

Your env file simply contains the port you want to run from and the redis configuration.

# Essential Configurations
PORT=8021

# Redis
REDIS_URL=127.0.0.1:6379
REDIS_PASSWORD=""
REDIS_DB=0

Fire It Up

go run raithe.go

Raithe

Your Agents List

Your agents list will contain all agents that can register as a "producer" or "consumer", both are the same to Raithe. Contained within your agents_list.json of the root folder you will see something like this. Just list the names of the agents and each agent will need to call the register path (/auth/register) to stake thier claim on that agent name.

{
  "agents": [
    "test"
  ]
}

Playing Around

Register Clients

A Client is any service attempting to push or pop from the message queue.
Contained within the root directory is a file agents_list.json. This file contains all the agents that can register and is read in realtime. So Adding an agent is easy.

Request /auth/register

{
	"agent_name":"{{agent name}}"
}

Response

{
    "success": true,
    "message": "",
    "security_token": {
        "agent_name": "{{agent name}}",
        "token": "{{token}}"
    }
}

Push Message

Pusing a message can be done by any agent. Queues are the key and will be how agents identify which queue to pull from.

Request /queue/push

{
	"queue":"test",
	"message":"Hello World",
	"security_token": {
        	"agent_name": "{{agent name}}",
        	"token": "{{token}}"
    }
}

Response

{
    "success": true
}

Pop Message

Popping a message from the queue will grab the oldest message first. Simple as that.

Request /queue/pop

{
	"queue":"test",
	"security_token": {
        	"agent_name": "{{agent name}}",
        	"token": "{{token}}"
    }
}

Response

{
    "queue": "test",
    "message": "Hello World"
}

Related Skills

View on GitHub
GitHub Stars4
CategoryDevelopment
Updated5y ago
Forks1

Languages

Go

Security Score

75/100

Audited on Oct 6, 2020

No findings