🚀 Socket Launch Week 🚀 Day 5: Introducing Socket Fix.Learn More

aliyun-amqp-user-utils-node

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aliyun-amqp-user-utils-node

Aliyun AMQP User Utils in NodeJS

1.0.3
latest
Version published
Maintainers
1
Created

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 => {
  // ...
})

FAQs

Package last updated on 31 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts