RailQ is a lightweight, SQS-inspired, in-memory queue service designed for easy deployment on Railway and other cloud platforms. It provides a simple REST API for message queuing, visibility timeouts, and message lifecycle management. Perfect for prototyping, development, and lightweight production use-cases.
- SQS-like REST API
- In-memory queue (no persistence)
- Message visibility timeout and retention
- Message stats (available/in-flight)
- Easy to deploy and configure via environment variables
-
Deploy to Railway (or run locally):
go run main.go # or build and run the binary go build -o railq && ./railq
-
Configure via Environment Variables:
QUEUE_VISIBILITY_TIMEOUT(default: 30) — seconds a message is hidden after being receivedQUEUE_RETENTION_PERIOD(default: "7d") — how long a message is retained (requires duration strings: e.g.30s,10m,2h,3d,4mo,1y)
All endpoints return JSON. Errors are returned as { "error": "..." }.
Enqueue a message.
{
"message": "your message text"
}Response:
{
"id": "string",
"body": "string",
"receiptHandle": "string",
"createdAt": "RFC3339 timestamp"
}Dequeue (lock) one or more messages for processing. Locked messages are hidden for the visibility timeout.
{
"maxMessages": 1 // optional, default 1
}Response:
[
{
"id": "string",
"body": "string",
"receiptHandle": "string",
"createdAt": "RFC3339 timestamp"
}
]Delete a message by receipt handle (after processing).
{
"receiptHandle": "string"
}Response:
- 204 No Content on success
- 404 Not Found if not found
Extend the visibility timeout for a locked message.
{
"receiptHandle": "string",
"seconds": 30
}Response:
- 204 No Content on success
- 404 Not Found if not found or not locked
Purge all messages from the queue. Response:
- 204 No Content
Get queue stats. Response:
{
"messagesAvailable": 0,
"messagesInFlight": 0
}Get current queue config (visibility timeout, retention, etc). Response:
{
"visibilityTimeoutSeconds": 30,
"retentionPeriodSeconds": 86400
}MIT