Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

weyoss/redis-smq-rest-api

Repository files navigation

RedisSMQ

A RESTful API for RedisSMQ

Important Notice

This repository has been archived and is no longer maintained. The RedisSMQ Monitor functionality has been moved to the main redis-smq repository. Please refer to the main repository for the latest updates and documentation.

What this means:

  • No further issues or pull requests will be accepted in this repository
  • All future updates and improvements will be made in the main redis-smq repository
  • Please direct all questions and contributions to the main repository

RedisSMQ REST API

RedisSMQ REST API offers an HTTP interface which allows any web capable application to interact with the RedisSMQ message queue using a RESTful API.

Currently, RedisSMQ REST API is distributed as an RC release and is still in active development.

To start using the REST API make sure that you are using the latest RedisSMQ V8 RC release.

Features

  • A clean and simple implementation as always :).
  • Strict Request/Response validation based on JSON Schema.
  • Native OpenAPI v3 support and Swagger for developers.
  • Rigorously tested codebase with code coverage no less than 90%.
  • Both ESM & CJS modules are supported.

Installation

npm i redis-smq-rest-api@rc --save

Configuration

The REST API configuration extends RedisSMQ Configuration while adding the API server configuration.

interface IApiServerConfig {
  port?: number;
  hostname?: string;
  basePath?: string;
}

interface IRedisSMQHttpApiConfig extends IRedisSMQConfig {
  apiServer?: IApiServerConfig;
}

Usage

import { IRedisSMQHttpApiConfig, RedisSMQRestApi } from 'redis-smq-rest-api';

const config: IRedisSMQHttpApiConfig = {
    redis: {
        client: ERedisConfigClient.IOREDIS,
        options: {
            host: '127.0.0.1',
            port: 6379,
        },
    },
    apiServer: {
        host: '127.0.0.1',
        port: 7210
    }
};

const apiServer = new RedisSMQRestApi(config);
apiServer.run();

API Reference

Once your RedisSMQ API server is up and running you may view the API Reference and try it directly from the Swagger UI which is accessible via http://<HOSTAME:PORT>/docs.

OpenAPI Specification

The OpenAPI specification is available at http://<HOSTAME:PORT>/assets/openapi-specs.json