0.3.5 • Published 6 years ago

mumba-microservice-wamp v0.3.5

Weekly downloads
-
License
Apache-2.0
Repository
gitlab
Last release
6 years ago

build status

Mumba Microservice WAMP

Provide WAMP support for a Microservice using mumba-wamp (via Autobahn).

DI Container

Adds an instance of WampClient object as "wampClient".

Adds an instance of WampSession object as "wampSessionApi".

Requires that a Config object has been registered as config.

When the artifacts resolve, it expects that the WAMP configuration is set in the wamp path in the Config object.

Installation

$ npm install --save mumba-microservice-wamp
$ typings install --save dicontainer=npm:mumba-typedef-dicontainer

Examples

const Sandal = require("sandal");
import {DiContainer} from "mumba-typedef-dicontainer";
import {Config} from "mumba-config";
import {MicroserviceWampModule} from "mumba-microservice-wamp";

let container: DiContainer = new Sandal();

// Set the configuration for the logger.
// (or include the Microservice Config Module and set `defaultConfig`)
container.object('config', new Config({
	wamp: {
		url: 'ws://mumba__crossbar:8080',
		realm: 'test-realm',
		authid: '1',
		authmethods: ['wampcra'],
		secret: '*password'
	}
}));

// Register the module.
MicroserviceWampModule.register(container);

container.resolve((err: Error, wampClient: any) => {
	if (err) {
		throw err;
	}

	// Connect to WAMP
});

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm run docker:up
$ npm install
$ npm test
$ npm docker:down

People

The original author of Mumba Microservice WAMP is Andrew Eddie.

List of all contributors

License

Apache 2.0


© 2016 Mumba Pty Ltd. All rights reserved.

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago