Questions tagged [node-amqp]

node-amqp is an AMQP client for nodejs.

AMQP 0-9-1 library and client for Node.JS.

This library does not implement AMQP 1.0 or AMQP 0-10.

Github: https://github.com/squaremo/amqp.node

105 questions
218
votes
13 answers

RabbitMQ / AMQP: single queue, multiple consumers for same message?

I am just starting to use RabbitMQ and AMQP in general. I have a queue of messages I have multiple consumers, which I would like to do different things with the same message. Most of the RabbitMQ documentation seems to be focused on round-robin,…
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
44
votes
1 answer

How to requeue messages in RabbitMQ

After the consumer gets a message, consumer/worker does some validations and then call web service. In this phase, if any error occurs or validation fails, we want the message put back to the queue it was originally consumed from. I have read…
yunus kula
  • 859
  • 3
  • 10
  • 31
25
votes
1 answer

Should I close the channel/connection after every publish?

I am using amqplib in Node.js, and I am not clear about the best practices in my code. Basically, my current code calls the amqp.connect() when the Node server starts up, and then uses a different channel for each producer and each consumer,…
Noam Gal
  • 3,315
  • 3
  • 36
  • 53
11
votes
1 answer

Sending RabbitMQ messages via websockets

Looking for some code samples to solve this problem :- Would like to write some code (Python or Javascript) that would act as a subscriber to a RabbitMQ queue so that on receiving a message it would broadcast the message via websockets to any…
bzo
  • 1,532
  • 7
  • 27
  • 40
11
votes
2 answers

How to convert AQMP message buffer into JSON object when using node.js amqp module?

I am using node.js amqp module for reading messages from a queue. The following is the callback that is invoked when there is a message available on the queue: function onMessage(message, headers, deliveryInfo) { console.log(message); //This…
Anand Patel
  • 6,031
  • 11
  • 48
  • 67
9
votes
1 answer

amqp.node won't detect a connection drop

We have a node.js script running a socket.io server whose clients consume messages from a RabbitMQ queue. We've recently migrated to Amazon AWS and RabbitMQ is now a cluster of two machines (redundant instances). The AMQP connection is lost from…
Piovezan
  • 3,215
  • 1
  • 28
  • 45
9
votes
2 answers

Node-amqp - rejecting message after X attempts

How do I implement mechanism which reject message after few configurable requeue attempts? In other words, if I'm subscribing to a queue I want to guaranty that same message does not redelivered more then X times. My code sample: q.subscribe({ack:…
shaiis.com
  • 244
  • 4
  • 10
9
votes
1 answer

node-amqp cannot send message to RabbitMQ

I'm tring rabbitmq-tutorials, ruby version works fine, but node.js version cannot send message. I do not know what is wrong. var amqp = require('amqp'); var amqp_hacks = require('./amqp-hacks'); var connection = amqp.createConnection({host:…
nfpyfzyf
  • 2,891
  • 6
  • 26
  • 30
6
votes
1 answer

RabbitMQ and node-amqp: Exchange in confirmed mode does not confirm - why?

I am writing a Node.js application that relies on RabbitMQ. I'm using node-amqp as the library of choice to connect to RabbitMQ. Once I have established a connection to RabbitMQ, first thing I am going to do is to create an exchange: var options = {…
Golo Roden
  • 140,679
  • 96
  • 298
  • 425
5
votes
1 answer

RabbitMQ / AMQP: multiple queues, single consumer

I want to create a consumer that process messages from multiple variable number of sources, that are connected or disconnected dynamically. What I need is that each consumer prioritize first N messages of each source. Then to run multiple consumers…
jamg
  • 91
  • 1
  • 6
5
votes
0 answers

AMQPLib Detecting / Handling Channel Close

I'm looking for the recommended way to deal with un-expected channel closures via this library. I gather from the documentation that there is an event emitted, but it's not quite clear to me how best to detect that event (I know this is simple, but…
Michael
  • 4,010
  • 4
  • 28
  • 49
5
votes
0 answers

Idle timeout on RabbitMQ Connection causes channels to leak

I using node-amqp with Node.js to consume messages off a queue. Our admins have a 60 minute idle connection timeout, which causes an additional queue to be bound and orphan the previous channels for my queue that were created previously. My logs…
occasl
  • 5,303
  • 5
  • 56
  • 81
5
votes
1 answer

RabbitMQ and Node.js how to handle failover scenario?

I am using RabbitMQ (cluster) and connecting to it using a Node.js client (node-amqp - https://github.com/postwait/node-amqp). The RabbitMQ docs states that handling a failover scenario (cluster's node failure) should be handled by the client…
Momico
  • 85
  • 1
  • 8
5
votes
1 answer

authentication failure working with node-amqp library while switching to stomp-client, it works

I am using the node-amqp library to connect to a on-line stomp service, before I was using stomp-client, it was connected very successfully, but it doesn't support auto failure detection and reconnect, so I want to switch to node-amqp for more…
user824624
  • 7,077
  • 27
  • 106
  • 183
4
votes
2 answers

Angular 10: Buffer is not defined

I need some help cause I don't have any idea what to do. I have to use 'amqplib' in my Angular project. Firstly I have tried to use 'amqp-ts', but as soon as I've opened a browser I had an error: After several tries, I have switched to 'amqplib'.…
Jadw1
  • 139
  • 1
  • 2
  • 3
1
2 3 4 5 6 7