Skip to content
/ mq Public

A simple interface to message queue implementation(s)

Notifications You must be signed in to change notification settings

c3sr/mq

Repository files navigation

MLModelScope Message Queue

This library provides an abstraction layer for a lower level message queue implementation. The goal is to provide a simple interface for interacting with a message queue in MLModelScope.

Requirements

This library requires go version >= 1.13

Supported Message Queues

Support is currently provided for:

  • RabbitMQ (AMQP 0.9.1)

Configuration

When a message queue is created using mq.NewMessageQueue, configuration is read from environment variables. The following variables must be set for a message queue to be configured correctly:

  • MQ_HOST the hostname of the message queue server
  • MQ_PORT the port number the message queue server listens on
  • MQ_USER a username that can login to the message queue server
  • MQ_PASSWORD the password that corresponds to the username

Integration tests

A small suite of integration tests are included for the supported message queue implementation(s). These tests require a functional message queue server to connect to. Configuration for connecting to the message queue must be provided in the environment variables listed above.

The script at /scripts/run-integration-tests.sh will start a RabbitMQ server in a docker container and run the integration tests against it. This requires that you have Docker and at least go version 1.13 installed.

Code Coverage

The script at /scripts/generate-coverage-report.sh will run the Unit and Integration tests with coverage, and produce a report coverage.html from the merged results.

About

A simple interface to message queue implementation(s)

Resources

Stars

Watchers

Forks

Packages

No packages published