0.0.3 • Published 3 years ago
only-pubsub v0.0.3
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'
})
0.0.3
3 years ago