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