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
5
votes
2 answers

How do I get old messages from RabbitMQ?

I'm publishing RabbitMQ messages using Bunny (Ruby) like this: x.publish("Message !"+n.to_s, :routing_key => 'mychannel') and subscribing like this: ch = conn.create_channel x = ch.topic('fling',durable: true) q = ch.queue("") q.bind(x,…
Louise
  • 1,063
  • 1
  • 9
  • 20
5
votes
1 answer

Reasons to not use the default exchange on RabbitMQ?

I've started working with RabbitMQ and my use case is quite simple - producers putting messages on queues to to processed by consumers. Each message is processed by at most one consumer and messages are directed from producer to consumer based on…
user783836
  • 3,099
  • 2
  • 29
  • 34
5
votes
0 answers

RabbitMQ : Create Dynamic queues in Direct Exchange

I am new to RabbitMQ, I just went through Rabbitmq docs (Routing). I am quite confused between Exchange with routing keys. My requirement is , I want to create multiple queues dynamically. Please refer below diagram. Ex. Lets say If producer create…
Morez
  • 2,048
  • 5
  • 36
  • 49
5
votes
2 answers

Scaling in Rabbitmq

While using Clusters in Rabbit MQ, I was planning to use the Competing Subscriber pattern. Producer : 1 Exchange : 1 direct Queue : 1 Consumers : n (multiple) listening to the same queue. Now if I have a cluster containing 3 nodes, there would be…
Lalit Singh Rana
  • 137
  • 1
  • 1
  • 10
5
votes
1 answer

Why declare Exchange in RabbitMQ?

I am working on a project with RabbitMQ. My code is below. Producer: public static void Main() { var factory = new ConnectionFactory() { HostName = "localhost" }; using (var connection = factory.CreateConnection()) { using (var…
user3532803
4
votes
2 answers

Is it possible to consume an exchange in RabbitMQ?

Maybe I am asking the wrong question here. what I'm trying to do: multiple producers push data in dynamic categories into a Named exchange. multiple consumers need to pick up this data from these dynamically named queues and act on them. the problem…
Oren Mazor
  • 4,437
  • 2
  • 29
  • 28
4
votes
1 answer

How to set x-dead-letter-exchange in Rabbit?

Here are my beans: @Bean public Queue igSmev3ListenerQueue() { Map args = new HashMap<>(); args.put("x-dead-letter-exchange", rabbitIgSmev3DlxProperties.getExchangeName()); …
Maksym Rybalkin
  • 453
  • 1
  • 8
  • 22
4
votes
1 answer

One exchange with multiple routing keys or multiple exchanges efficient in RabbitMQ

I am using RabbitMQ in my project and was wondering if I should use a single exchange with multiple routing keys or use multiple exchanges? Which would be more efficient? Example if I use single exchange E with routing keys A,B,C and consumer…
Tushar Seth
  • 563
  • 7
  • 15
4
votes
5 answers

How to move messages from one queue to another in RabbitMQ

In RabbitMQ,I have a failure queue, in which I have all the failed messages from different Queues. Now I want to give the functionality of 'Retry', so that administrator can again move the failed messages to their respective queue. The idea is…
4
votes
1 answer

Rabbitmq headers exchange and confirmed delivery

I'm trying to use headers exchange on RabbitMQ, with mixed java and python components, and I need confirmed delivery. I seem to get different a behaviour from the python (pika) and java clients. In…
apanday
  • 511
  • 4
  • 15
4
votes
2 answers

rabbitmq: can consumer persist message change before nack?

Before a consumer nacks a message, is there any way the consumer can modify the message's state so that when the consumer consumes it upon redelivery, it sees that changed state. I'd rather not reject + reenqueue new message, but please let me know…
lf215
  • 1,185
  • 7
  • 41
  • 83
4
votes
0 answers

RabbitMq federated exchange message ordering guarantees

Are there any message ordering guarantees in RabbitMq federated exchanges? According to https://www.rabbitmq.com/semantics.html Section 4.7 of the AMQP 0-9-1 core specification explains the conditions under which ordering is guaranteed: messages…
4
votes
1 answer

RabbitMQ - ExchangeDeclare rejected with ACCESS_REFUSED in a .NET client

I'm quite new with RabbitMQ and I've got to implement a .NET client that needs to publish messages to an Exchange entity on a RabbitMQ server hosted by a third party. The connection to the server seems to work well but then, things are gettings…
pierroz
  • 7,653
  • 9
  • 48
  • 60
4
votes
1 answer

RabbitMQ consumer in Go

I am trying to write a RabbitMQ Consumer in Go. Which is suppose to take the 5 objects at a time from the queue and process them. Moreover, it is suppose to acknowledge if successfully processed else send to the dead-letter queue for 5 times and…
Naresh
  • 5,073
  • 12
  • 67
  • 124
4
votes
2 answers

Spring rabbitmq send to exchange with dynamic binding

I try to use TopicExchange for masking a messages. Config:
1 2
3
27 28