Questions tagged [rabbitmq-exchange]

In RabbitMQ, messages are not published directly to a queue. Instead, the producer sends messages to an exchange. Use this tag only if your question is about the RabbitMQ Exchanges, or if the question revolves around the routing keys or message queues to which the exchange delivers the message for end publishing.

RabbitMQ is a message broker based on the AMPQ protocol.

Exchanges are AMQP entities where messages are sent. Exchanges take a message and route it into zero or more queues. The routing algorithm used depends on the exchange type and rules called bindings. AMQP 0-9-1 brokers provide four exchange types:

  • Direct exchange: (empty string) and amq.direct
  • Fanout exchange: amq.fanout
  • Topic exchange: amq.topic
  • Headers exchange: amq.match (and amq.headers in RabbitMQ)

Besides the exchange type, exchanges are declared with a number of attributes, the most important of which are:

  • Name
  • Durability (exchanges survive broker restart)
  • Auto-delete (exchange is deleted when all queues have finished using it)
  • Arguments (these are broker-dependent)

Exchanges can be durable or transient. Durable exchanges survive broker restart, whereas transient exchanges do not (they have to be redeclared when the broker comes back online). Not all scenarios and use cases require exchanges to be durable.

RabbitMQ is open source message broker software (sometimes called message-oriented middleware) that implements the Advanced Message Queuing Protocol (AMQP). The RabbitMQ server is written in the Erlang programming language and is built on the Open Telecom Platform framework for clustering and failover. Client libraries to interface with the broker are available for all major programming languages.

419 questions
3
votes
2 answers

RabbitMQ Manual Retry

How can manual retry work in RabbitMQ after a message has been put onto dead letter queue? Does RabbitMQ provide an user interface through which you can do this? I assume here that RabbitMQ console does not provide you this capability.
Ankur
  • 149
  • 10
3
votes
1 answer

Why shouldn't I use rabbitmq topic exchanges for everything?

It seems like the worker pattern, fanout, and filtered topics can all be implemented with topic exchanges. Why would I ever use a direct or fanout exchange instead? We would like to codify common patterns found in our org in a library that abstracts…
ben schwartz
  • 2,559
  • 1
  • 21
  • 20
3
votes
1 answer

requeue the message in rabbitmq using Spring ampq

I am new to rabbitmq and am trying the following scenario --> producer sends message --> consumer receives the message -- Execute my own logic if the logic fails - requeue --> requeue the message if the consumer fails(machine goes down) I…
Pradeep
  • 850
  • 2
  • 14
  • 27
3
votes
1 answer

Avail same messages to multiple RabbitMQ Consumers

Requirement: 1)I need to fetch data stored in Mongo DB through Java Application and using topic exchange & binding keys, created 3 queues on RabbitMQ. I have implemented everything up to this point. The problem starts from the 2nd point…
Badal
  • 376
  • 4
  • 11
3
votes
1 answer

List bindings for an exchange with rabbitmq java client API

I can't seem to find any information in the documentation so I was wondering if it was somehow possible to get all the bindings related to an exchange using the java RabbitMQ API. I'm looking for something like the http api result when querying…
yenox
  • 335
  • 5
  • 17
3
votes
1 answer

RabbitMQ - How to Federate / Mirror Messages

I setup two nodes, A and B. Both have RabbitMQ with the federation plugin installed. From the Web UI, I can see the "Federation Status" > "State" is "running" on A and B. On A, I created a queue called "test1". On B, I can see the "test1" queue…
okoboko
  • 4,332
  • 8
  • 40
  • 67
3
votes
2 answers

Know position of a Task in RabbitMQ

I was planning to use RabbitMQ for a project in which I require to know position of my task after every few second in the queue. Say I am using it for generating reports and if there is a Queue then I would want to show the user his position in the…
HackerNews
  • 153
  • 1
  • 10
2
votes
1 answer

RabbitMQ.Client.Exceptions.OperationInterruptedException

I'm working on my student project related to Notification Brokers. As a sample our teacher provided us with the following repository: https://github.com/DeveloperStories/RabbitMQ. I selected Publisher project inside the RabbitMQ solution and ran it…
Alex
  • 124
  • 8
2
votes
1 answer

Single active consumer (SAC) - having a consumer thread consume only from a single queue

I'm trying to use single active consumer (SAC) in queues bounded to consistent hash exchange, which has 4 queues. This is for distributing the messages based on routing key and to have ordered processing in each of the queues. Have set an Executor…
Mahudees
  • 41
  • 6
2
votes
0 answers

Rabbitmq requeue/queue with custom timeout

For reasons I can't use the delayed plugin. So I've made implemention with dead-letter-exchange. The thing is that my letters have different timeouts. Here comes the main problem: first letter with timeout 15s blocks letter with 1s timeout. Is there…
2
votes
0 answers

kombu for RabbitMQ cancel_by_queue method raise ChannelError - PreconditionFailed: Basic.ack

Using amqp==2.6.1 with kombu==4.6.11 - when trying to remove some queue using the method: self.consumer.cancel_by_queue(queue_name) the kombu library does the following: def cancel_by_queue(self, queue): """Cancel consumer by queue…
user2552806
2
votes
1 answer

AWS API gateway websocket receives messages inconsistently

I have a websocket in api gateway connected to a lambda that looks like this: const AWS = require('aws-sdk'); const amqp = require('amqplib'); const api = new AWS.ApiGatewayManagementApi({ endpoint: 'MY_ENDPOINT', }); async function…
2
votes
1 answer

Use RabbitMQ as procedure and Celery as consumer

I'm trying to use RabbitMQ, Celery, and Flask app to simply update the database. ProcedureAPI.py is an API that gets the data, inserts records in the database, and pushes data to the Radbbitmq server. Celery gets the data from Rabbit Queue and…
Mahipal Singh
  • 144
  • 1
  • 11
2
votes
1 answer

Spring AMQP - Can my spring app have multiple exchanges binding to each queues?

I have 2 different exchanges I want my queues to bind with, Below approach is not working Configuration File - @Configuration public class RabbitMQConfiguration { @Value("${spring.rabbitmq.host}") private String host; …
2
votes
0 answers

RabbitMQ - Message published, but not routed

We have a 5 pods 3.8.5 rabbitmq deployment on k8s using the bitnami helm chart, sometimes after a pod restart it seems that lots (but not all) routing keys on multiple exchanges stopped working with "Message published, but not routed." error. after…