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
2
votes
1 answer

RabbitMQ - Discard message if it is taking too long to process

Is there any way to make RabbitMQ discard the message if it is taking too long to process? For example, if I have an email queue and the consumer script is taking too long to send the email, make it discard the message (put it in the dead letter…
Kamran Ahmed
  • 11,809
  • 23
  • 69
  • 101
2
votes
1 answer

Is re-declaring queue for every message can decrease the rabbitmq performance?

Is declaring queues for every message can decrease the rabbitmq performance? We have a scenario in which we don't know the rabbitmq queue is exist or not. So declaring a queue for every message is a good approach?. Or we should check for each…
Rahul
  • 249
  • 2
  • 12
2
votes
1 answer

Does RabbitMQ guarantee the order in which published message confirmations are delivered back to the client?

For publishers that have sent the confirm.select method, a literal reading of the RabbitMQ broker documentation suggests that message confirmation responses may be received by the client in an order different from the order that the original…
Kevin Sitze
  • 8,029
  • 3
  • 16
  • 19
2
votes
1 answer

How to reuse RabbitMQ queues using exchanges?

I will explain what I want to achieve and then what I have done (without results) I have two node services connected between them with RabbitMQ ussing exchanges (topic): What I want is shutdown C1 while still sending messages to…
emilioriosvz
  • 1,629
  • 1
  • 19
  • 30
2
votes
1 answer

Grails rabbitmq native filter messages to consumer

I'm using grails 3.2.3 version and rabbitmq native plugin 3.3.2 (http://budjb.github.io/grails-rabbitmq-native/doc/manual/). I am trying to achieve the following scenario. Description: I'm sending multiple messages to a single queue with headers…
Mamun Sardar
  • 2,679
  • 4
  • 36
  • 44
2
votes
1 answer

RabbitMQ - Single concurrent worker per routing key

Quite new to RabbitMQ and I'm trying to see if I can achieve what I need with it. I am looking for the Worker Queues pattern but with one caveat. I want to have only a single worker running concurrently per routing key. An example for…
2
votes
2 answers

How to access channels/queues opened on a Bunny session?

I'm using Rabbit MQ's Ruby client (Bunny). I moved the hole Bunny config and initializing process in an initializer. How can I access channels/queues opened on a Bunny connection from inside a controller or a lib? I get 'true' when I call…
Bogdan Popa
  • 1,099
  • 1
  • 16
  • 37
2
votes
0 answers

Recovery of the connection in RabbitMQ for Clustered environment

I'm trying to recover the connection in RMQ for Clustered environment but unfortunately i'm not able to recover it in code and its also not catching in my exception. For example. Initially node 1 is connected and our messages has been flow…
2
votes
1 answer

RabbitMQ basic.return

If I publish with confirmation(model.ConfirmSelect) AKA basic.ack and mandatory flag. Will I always get the basic.return event before the basic.ack event if the message was not delivered. I want to add all basic.return messages to…
schizofreindly
  • 177
  • 2
  • 13
2
votes
1 answer

Get all Messages in a RabbitMQ queue as csv or excel

I have around 10000 messages in my RabbitMq queue in ready state. I am thinking of purging the messages but before purging I need to get all the message details downloaded as a csv or excel for backup purpose. Is there a way to do this. I am using…
Rachit M Garg
  • 263
  • 4
  • 19
2
votes
2 answers

How can I modify delivery(message) inside custom exchange for RabbitMQ 3.5.6?

I am writing custom exchange for RabbitMQ which must take arguments from exchange and put them to message headers. I am not very familiar with…
2
votes
2 answers

Using RabbitMQ - Multiple Producer and Multiple Consumers

I would like to know if it is possible to have multiples producers and multiple consumers? For example: -> Consumer A only receives message from Producer A -> Consumer B only receives message from Producer B Or Do i need to create multiple…
p.magalhaes
  • 7,595
  • 10
  • 53
  • 108
2
votes
1 answer

Long time unacknowledged message in RabbitMQ

I have a business process that receives an order from a RabbitMQ queue. I was thinking about not acknowledging it (meaning, leave it in the queue) for potentially a long time (>10 minutes) and only then either removing it (acknowledging) or not (not…
Ricardo Peres
  • 13,724
  • 5
  • 57
  • 74
2
votes
1 answer

RabbitMQ Structure For Private Messaging

I am currently looking to buildout a messaging service where users can send and receive messages privately between each other. I may have a need for multi-user chat, but for the most part, I only want single recipients to be able to read messages…
Jacob
  • 21
  • 2
2
votes
3 answers

RabbitMQ header exchange with list

I am having some issues trying to understand how an exchange of type headers works. Only one exchange, myExchange Three queues: myQueue1 myQueue2 myQueue3 Bindings: myExchange => myQueue1 (x-match: any, myHeader: [test1]) myExchange =>…
ab_732
  • 3,639
  • 6
  • 45
  • 61