rabbit-topology

3.0.0 • Public • Published

rabbit-topology

NPM Version Build Coverage

Initial release designed to generate a topology definition.
Other libraries are used to assert the topology against a running server.

Produce a rabbit topology definition from a DSL.

Domain-Specific Language

TODO: Formally define the DSL

Examples

Publisher

const definition = {
    exchanges: {
        "app.events": {
            type: "fanout",
            exchanges: {
                "app.events.topic": {
                    type: "topic"
                }
            }
        }
    }
}

Subscriber

const definition = {
    exchanges: {
        "app.service": {
            type: "fanout",
            queues: {
                inbound: {
                    name: "app.service.queue",
                    durable: true,
                    prefetch: 50,
                    deadLetterExchange: {
                        name: "app.service.dlx",
                        type: "fanout",
                        queues: {
                            "ingress.dlq": { durable: true }
                        }
                    }
                }
            },
            subscriptions: {
                "app.events.topic": {
                    type: "topic",
                    patterns: [ "app.#" ]
                }
            }
        }
    }
};
const topology = parser.parse( definition );
console.log( topology.queues.inbound );  // "app.service.queue"

Readme

Keywords

none

Package Sidebar

Install

npm i rabbit-topology

Weekly Downloads

0

Version

3.0.0

License

none

Last publish

Collaborators

  • bunk