
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
amqp-simple-pub-sub
Advanced tools
A simple Pub Sub system that uses AMQP Messaging to exchange data between services
A simple Pub Sub system that uses AMQP Messaging to exchange data between services
Branch | Tests | Code Coverage | Comments |
---|---|---|---|
develop | Work in progress | ||
master | Latest release |
You project needs to be using at least Node version 8, and ideally Node 10 (LTS) or later.
npm install amqp-simple-pub-sub
const { makePublisher } = require('amqp-simple-pub-sub')
const publisher = makePublisher({ exchange: 'testService' })
await publisher.start()
publisher.publish('test', 'Hello World')
const { makeSubscriber } = require('amqp-simple-pub-sub')
const subscriber = makeSubscriber({
exchange: 'testService',
queueName: 'testQueue',
routingKeys: ['test']
})
const handler = message => {
console.log('Message Received', message)
subscriber.ack(message)
}
subscriber.start(handler)
The full options object is as follows
{
type: 'topic', // the default
url: 'amqp://localhost', // the default
exchange: 'you must provide this', // it's the name of your service usually
onError: err => { // optional
console.error('A connection error happened', err) // or do something clever
},
onClose: () => { // optional
console.log('The connection has closed.') // or do something clever
}
}
The full options object is as follows
{
type: 'topic', // the default
url: 'amqp://localhost', // the default
exchange: 'you must provide this', // it's the name of your service usually
queueName: 'you must also provide this', // give your queue a name
routingKeys: ['an', 'array', 'of', 'routingKeys'], // optional. Uses [queueName] otherwise.
onError: err => { // optional
console.error('A connection error happened', err) // or do something clever
},
onClose: () => { // optional
console.log('The connection has closed.') // or do something clever
}
}
See some examples in the tests, and also:
amqp-delegate
— A library that simplifies, to the point of triviality, use of AMQP based remote workers.ampq-event-tester
— A Dockerised and configurable utility to help integration-test your amqp services.nvm
to manage Node versions — brew install nvm
.)npm install
docker-compose up -d
Runs Rabbit MQ.
npm test
— runs the unit tests (quick and does not need rabbit mq running)npm run test:integration
— runs the integration tests (not so quick and needs rabbitmq running)npm run lint
Please see the contributing notes.
FAQs
A Pub Sub system that uses AMQP Messaging to exchange data between services
The npm package amqp-simple-pub-sub receives a total of 86 weekly downloads. As such, amqp-simple-pub-sub popularity was classified as not popular.
We found that amqp-simple-pub-sub 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.