New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mq-helper

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mq-helper - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

.npmignore

26

index.js

@@ -15,8 +15,9 @@ const debug = require('debug')('MQ');

this.PREFIX = PREFIX;
this.rpcQueueName = PREFIX + 'rpc_queue';
}
async getConnection() {
let connection = amqp.connect(this.url);
let connection = amqp.connect(this.URL);
return await new Promise((resolve, reject) => {

@@ -42,6 +43,4 @@ connection

this.connection = connection;
let channel = await connection.createChannel();
this.channel = channel;
this.channel = channel;
};

@@ -53,6 +52,7 @@

async queueSend(param) {
let {handlerName, data, corrId, id, name} = param;
let {handlerName, data, name} = param;
if(name == null) name = "default";
let sendName = name + "_request";
let sendName = name;

@@ -65,6 +65,3 @@ try {

let content = {
data: data,
index: {
id
}
data: data
};

@@ -77,3 +74,3 @@

new Buffer(JSON.stringify(content)),
{ correlationId: corrId, replyTo: q.queue }
{ replyTo: q.queue }
);

@@ -86,8 +83,7 @@

async queueConsume(params) {
try {
let {name, handler} = params;
if(name == null) name = "default";
let consumeName = name + "_request";
let consumeName = name ;
console.log("consumeName", consumeName)
let q = await this.channel.assertQueue(consumeName);

@@ -94,0 +90,0 @@ this.channel.consume(q.queue, handler(this));

{
"name": "mq-helper",
"version": "0.1.0",
"version": "0.1.1",
"main": "index.js",

@@ -5,0 +5,0 @@ "description": "",

@@ -23,5 +23,14 @@ const MQHelper = require('./../index')

data:{msg: 1},
corrId:"1122334",
id:1,
...QUEUES[0]
name: "tasks",
handler: (mqHelper) => {
return (msg) => {
msg.content = msg.content.toString('utf8');
let execute = (msg) => {
console.log(msg.content);
}
execute(msg);
mqHelper.channel.ack(msg);
}
}
}

@@ -28,0 +37,0 @@

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