Home

Awesome

REST rsmq

Build Status

A REST interface for rsmq the really simple message queue based on Redis.

This REST interface makes it easy to use rsmq with other application platforms like php, .net etc. Simply call the RESTful methods to send and receive messages.

Note: There is no security built in - so use this only in a trusted enviroment, just like memcached.

Installation

Methods

changeMessageVisibility

PUT /message/qname/id

Change the visibility of the message with id id from queue qname.

Example:

PUT /message/myqueue/dhxekddac921a9422ec10e5439b55aa62e4dd49142?vt=5

Response:

{"result": 1}

createQueue

POST /queues/qname

Create a new queue qname

Parameters:

Example:

POST /queues/myqueue
Content-Type: application/json

{
	"vt": 30,
	"delay": 0,
	"maxsize": 2048
}

Response:

{"result": 1}

deleteMessage

DELETE /messages/qname/id

Delete the message with id id from queue qname.

Example:

DELETE /messages/myqueue/dhxekddac921a9422ec10e5439b55aa62e4dd49142

Response:

{"result": 1}

deleteQueue

DELETE /queues/qname

Delete the queue qname and all messages in that queue.

Example:

DELETE /queues/myqueue

Response:

{"result": 1}

getQueueAttributes

Get queue attributes, counter and stats

Parameters:

Example:

GET /queues/myqueue

Response:

{
    "vt": 30,
    "delay": 0,
    "maxsize": 65536,
    "totalrecv": 32,
    "totalsent": 13,
    "created": 1371645477,
    "modified": 1371645477,
    "msgs": 4,
    "hiddenmsgs": 2
}

listQueues

GET /queues

List all queues.

Example:

GET /queues

Response:

{"queues": ["myqueue","someOtherQueue"]}

receiveMessage

GET /messages/qname

Receive the next message from the queue.

Parameters:

Example:

GET /messages/myqueue?vt=30

Response:

{
    "id": "dhxeguaqv8cb2c78e9b5c97121d60f4caf54925c03",
    "message": "Hello World!",
    "rc": 1,
    "fr": 1370856862274,
    "sent": 1370855815832
}

sendMessage

POST /messages/qname

Sends a new message.

Example:

POST /messages/myqueue
Content-Type: application/json

{
	"message": "Hello World!",
	"delay": 0
}

Response:

{
    "id": "dhxekddac921a9422ec10e5439b55aa62e4dd49142"
}

The MIT License (MIT)

Please see the LICENSE.md file.