servicebus
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -15,2 +15,3 @@ var amqp = require('amqp'), | ||
options.url = options.url || process.env.RABBITMQ_URL || 'amqp://localhost'; | ||
options.vhost = options.vhost || process.env.RABBITMQ_VHOST || '/'; | ||
@@ -17,0 +18,0 @@ this.delayOnStartup = options.delayOnStartup || 10; |
@@ -9,3 +9,3 @@ { | ||
"description": "Simple service bus for sending events between processes using amqp.", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"homepage": "https://github.com/mateodelnorte/servicebus", | ||
@@ -12,0 +12,0 @@ "repository": { |
@@ -32,2 +32,4 @@ # servicebus | ||
(Note: message acking requires use of the retry() middleware, referenced below below) | ||
Servicebus integrates with RabbitMQ's message acknowledement functionality, which causes messages to queue instead of sending until the listening processes marks any previously received message as acknowledged or rejected. Messages can be acknowledged or rejected with the following syntax. To use ack and reject, it must be specified when defining the listening function: | ||
@@ -61,3 +63,16 @@ | ||
}, 1000); | ||
# Topic Routing | ||
To use topic routing to accept multiple events in a single handler, use publish and subscribe and the following syntax: | ||
``` | ||
bus.publish('event.one', { event: 'one' }); | ||
bus.publish('event.two', { event: 'two' }); | ||
``` | ||
and for the listener... | ||
``` | ||
bus.subscribe('event.*', function (msg) ... | ||
``` | ||
# Middleware | ||
@@ -64,0 +79,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
34029
774
153
6