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

@techloop/amqp-broker

Package Overview
Dependencies
Maintainers
8
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@techloop/amqp-broker - npm Package Compare versions

Comparing version 1.5.1 to 1.5.2

27

lib/broker.js

@@ -31,3 +31,3 @@ if (!process.env.EXCHANGE_NAME) {

onQueueOpen(q, failed_q) {
onQueueOpen(q) {
console.log(`Queue ${q.name} was opened`);

@@ -39,6 +39,2 @@ this.set('q', q);

splittedBinds.forEach(bindTo => {
if (failed_q) {
bindTo = `failed.${bindTo}`;
}
console.log(bindTo);

@@ -48,7 +44,17 @@ q.bind(this.exchange, bindTo, onQueueBind(q.name, bindTo));

if (!failed_q) {
q.subscribe(parseIncomingMessage);
}
q.subscribe(parseIncomingMessage);
}
onFailedQueueOpen(q) {
console.log(`Queue ${q.name} was opened`);
this.set('q', q);
const onQueueBind = this.opts.onQueueBind;
const splittedBinds = this.opts.bindTo.split(",");
splittedBinds.forEach(bindTo => {
bindTo = `failed.${bindTo}`;
console.log(bindTo);
q.bind(this.exchange, bindTo, onQueueBind(q.name, bindTo));
});
}
set(key, value) {

@@ -65,2 +71,3 @@ this[key] = value;

const onQueueOpen = this.onQueueOpen.bind(this);
const onFailedQueueOpen = this.onFailedQueueOpen.bind(this);
const set = this.set.bind(this);

@@ -75,4 +82,4 @@ AMQP((err, connection, exchange) => {

const options = { autoDelete: false, durable: true };
connection.queue(process.env.QUEUE_NAME, options, (q) => { onQueueOpen(q, false) });
connection.queue(`${process.env.QUEUE_NAME}_failed`, options, (q) => { onQueueOpen(q, true) });
connection.queue(process.env.QUEUE_NAME, options, (q) => { onQueueOpen(q) });
connection.queue(`${process.env.QUEUE_NAME}_failed`, options, (q) => { onFailedQueueOpen(q) });
});

@@ -79,0 +86,0 @@ }

{
"name": "@techloop/amqp-broker",
"version": "1.5.1",
"version": "1.5.2",
"description": "AMQP broker for microservices communication",

@@ -5,0 +5,0 @@ "main": "index.js",

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