only-pubsub
v0.0.3
Published
Only Function Pub Sub
Downloads
2
Readme
Onlyfunction PubSub
Installation
Add dependency in your package.json
file
{
"dependencies": {
"only-pubsub": "latest"
}
}
Kafka
const { Kafka } = require('only-pubsub')
const pubsub = new Kafka({
key: 'mykafka', // addon key
})
// publish message
pubsub.publish({
topic: 'mytopic',
key: 'say',
message: 'Hello world',
})
RabbitMQ
const { RabbitMQ } = require('only-pubsub')
const pubsub = new RabbitMQ({
key: 'myrabbit', // addon key
})
// publish message
pubsub.publish({
topic: 'mytopic',
message: 'Hello world'
})