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

@bss-sbc/rabbitmq-connection-instance

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bss-sbc/rabbitmq-connection-instance

README.md

  • 1.0.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

RabbitMQ Connection Instance

API References

RabbitMQ

  • connect(uri: string, options?: Options): Promise<NodeJS.Timeout | undefined>;

  • publish(queue: string, exchange: string, type: string, routingKey: string, data: any): Promise<boolean | undefined>;

  • consume(queue: string, onMessage: OnMessage): Promise<Replies.Consume | undefined>;

  • stopConsume(queue: string): Promise<void>;

  • getConnection(): Connection | undefined;

Examples

Javascript

const { RabbitMQ } = require(`@bss-sbc/rabbitmq-connection-instance`);

const instance = new RabbitMQ();
instance
    .connect(`amqps://oronngzc:KyHeBT-xzjLNEImdB3LmP7lhz9w2FRQD@armadillo.rmq.cloudamqp.com/oronngzc`)
    .then(() => console.log(instance.getConnection))
    .then(() => process.exit(0));

import { RabbitMQ } from '@bss-sbc/rabbitmq-connection-instance';

class SingletonRabbitMQ extends RabbitMQ {
    private static instance: SingletonRabbitMQ;
    private constructor() {
        super();
    }
    public static getInstance(): SingletonRabbitMQ {
        if (!SingletonRabbitMQ.instance) {
            SingletonRabbitMQ.instance = new SingletonRabbitMQ();
        }
        return SingletonRabbitMQ.instance;
    }
}


SingletonRabbitMQ.getInstance()
    .connect(`amqps://oronngzc:KyHeBT-xzjLNEImdB3LmP7lhz9w2FRQD@armadillo.rmq.cloudamqp.com/oronngzc`)
    .then(() => console.log(SingletonRabbitMQ.getInstance().getConnection()))
    .then(() => process.exit(0));

FAQs

Package last updated on 08 May 2023

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