Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
sbus-amqp10
Advanced tools
Adapter for node-sbus module to use amqp10 module for all AMQP calls (amqp10 has no native code).
sbus-amqp10
is a simple adapter you can pass to sbus
(GitHub | NPM) to have it use the amqp10
(GitHub | NPM)
module for all AMQP calls. Since amqp10
, unlike node-qpid
, has no native code dependencies it can run on a variety of hardware platforms that are denied to Apache's Qpid Proton.
This adapter is used internally by the sbus
module, which it uses itself via the static EventHubClient
and ServiceBusClient
methods.
So to e.g. talk to Azure's EventHub, you would simply call require('sbus-amqp10').EventHubClient()
and it would return a sbus
instance suitable for talking AMQP via amqp10
. That complicated implementation detail is meant to make it easy for you to use the library,
however, so let's see some code!
To receive messages from all partitions of myEventHub
in myServiceBus
(you can leave off the .servicebus.windows.net - it's assumed), and store state in myTableStore
:
// Set up variables
var serviceBus = 'myServiceBus',
eventHubName = 'myEventHub',
sasKeyName = ..., // A SAS Key Name for the Event Hub, with Receive privilege
sasKey = ..., // The key value
tableStorageName = 'myTableStore',
tableStorageKey = ..., // The key for the above table store
consumerGroup = '$Default';
var Sbus = require('sbus-amqp10');
var hub = Sbus.EventHubClient(serviceBus, eventHubName, sasKeyName, sasKey);
hub.getEventProcessor(consumerGroup, function (conn_err, processor) {
if (conn_err) { ... do something ... } else {
processor.set_storage(tableStorageName, tableStorageKey);
processor.init(function (rx_err, partition, payload) {
if (rx_err) { ... do something ... } else {
// Process the JSON payload
}
}, function (init_err) {
if (init_err) { ... do something ... } else {
processor.receive();
}
});
}
});
For sending messages, it's even easier:
// Set up variables as above
var Sbus = require('sbus-amqp10');
var hub = Sbus.EventHubClient(serviceBus, eventHubName, sasKeyName, sasKey);
hub.send({ 'myJSON': 'payload' }, 'partitionKey', function(tx_err) { });
Please see amqp10
(GitHub | NPM) for open issues with the underlying AMQP library, and
sbus
(GitHub | NPM) for issues with the ServiceBus/EventHub wrapper. The issues for this adapter
will be managed in its GitHub issues page, but the primary issue at this time is:
sbus
relies on five simple methods to provide AMQP support - two for service bus, two for event hub, one for teardown:
send(uri, payload, cb)
JSON.stringify
'd), or a string.receive(uri, cb)
eventHubSend(uri, payload, [partitionKey], cb)
JSON.stringify
'd), or a string.eventHubReceive(uri, [offset], cb)
disconnect(cb)
Any class implementing these five methods is duck-type compatible with sbus
and can be used.
FAQs
Adapter for node-sbus module to use amqp10 module for all AMQP calls (amqp10 has no native code).
The npm package sbus-amqp10 receives a total of 1 weekly downloads. As such, sbus-amqp10 popularity was classified as not popular.
We found that sbus-amqp10 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.