Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

amqp-service

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amqp-service

AMQP client

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

AMQP Service

| Download only 1.2.0+ versions only, cause lower versions contain bugs

AMQP service which can fetch and send messages to queues

Usage

Config

# Advanced Message Queue Protocol settings
amqp:
  # AMQP Server settings
  # You can read more about this settings [here](http://www.squaremobius.net/amqp.node/channel_api.html#connect)
  server:
    protocol: 'amqp'
    hostname: 'localhost'
    port: 5672
    username: 'guest'
    password: 'guest'
    vhost: '/'
    locale: 'en_US'
    frameMax: 0
    heartbeat: 60
  # The Queues which will be added to program
  # Note that you can change only value of this keys, cause keys are hardcoded in code
  queues:
    # Name of the Queue
    # Params of the Queue
    # You can read more about this params [here](http://www.squaremobius.net/amqp.node/channel_api.html#channel_assertQueue)
    # Event that triggers when consumer receive msg from this queue
    # Your event handler will receive deserialized and parsed msg
    - name: 'first_queue'
      params:
        durable: false
      event: 'on_amqp_first_queue'
    - name: 'second_queue'
      params:
        durable: false
      event: 'on_amqp_second_queue'

Code in project

const amqpService = new AMQPService(
    config.get('amqp.server'),
    config.get('amqp.queues')
);

await amqpService.start();
// If you want to stop AMQP Service use `amqpService.stop()`

// If you want to send Message to queue:
await amqpService.sendMessage('first_queue', {
    hello: 'world'
});

// If you want to handle messages from queue:
amqpService.on('on_amqp_first_queue', msg => {
    ...
});

Keywords

FAQs

Package last updated on 05 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc