Skip to content

tutv/httpmq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

httpmq npm CircleCI NPM npm

RabbitMQ via HTTP API in Node.js

Install

npm install httpmq --save
# yarn add httpmq

Create a client

const {createClient} = require('httpmq')

const uri = 'http://localhost:15672/vhost?prefixQueue=prefix'
const client = createClient(uri)

Functions

1. Connections

// Get list connections
const connections = await client.listConnections()

2. Queues

// Get list queues
const queues = await client.listQueues()

// Get sepecific queue
const queue = await client.getQueue('queueName')

// Send to queue
await client.sendToQueue('queueName', body, {ttl: 7200_000})

License

MIT