Rabbit topology parser
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
src
test/helpers
.babelrc
.editorconfig
.eslintignore
.eslintrc.yml
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
package.json

README.md

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"