mumba-microservice-wamp
TypeScript icon, indicating that this package has built-in type declarations

0.3.5 • Public • Published

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.

Package Sidebar

Install

npm i mumba-microservice-wamp

Weekly Downloads

0

Version

0.3.5

License

Apache-2.0

Unpacked Size

24.6 kB

Total Files

15

Last publish

Collaborators

  • arvin.domingo
  • dennis.barbamumba
  • mumba.cloud
  • carl-oehme-mumba
  • kennbaker