aliyun-amqp-user-utils-node
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Unofficial Aliyun AMQP User Utils in NodeJS

Summary

The official Java SDK Doc

https://help.aliyun.com/document_detail/106230.html

This project target to re-implement Java codes

https://onlinegdb.com/BkJVGFjd4

Usage

const amqplib = require('amqplib')
const userUtils = require('aliyun-amqp-user-utils-node')
 
const config = require('./config')
 
const getURL = () => {
  const userName = userUtils.getUserName(
    config.ALIYUN_AMQP_ACCESS_KEY_ID,
    config.ALIYUN_AMQP_RESOURCE_OWNER_ID
  )
  const password = userUtils.getPassword(config.ALIYUN_AMQP_ACCESS_KEY_SECRET)
 
  return {
    protocol: 'amqp',
    hostname: config.ALIYUN_AMQP_ADDRESS,
    port: 5672,
    username: userName,
    password: password,
    locale: 'en_US',
    frameMax: 0,
    heartbeat: 0,
    vhost: config.ALIYUN_AMQP_VHOST
  }
}
 
const open = amqplib.connect(getURL())
open.then(conn => {
  // ...
})

Package Sidebar

Install

npm i aliyun-amqp-user-utils-node

Weekly Downloads

6

Version

1.0.3

License

ISC

Unpacked Size

3.44 kB

Total Files

5

Last publish

Collaborators

  • emj365