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
110
votes
3 answers

What are the limits of messages, queues and exchanges?

What are the allowed types of messages (strings, bytes, integers, etc.)? What is the maximum size of a message? What is the maximum number of queues and exchanges?
tuchk4
  • 2,270
  • 5
  • 21
  • 34
62
votes
5 answers

Topic Exchange vs Direct Exchange in RabbitMQ

We've got an application which will be using RabbitMQ and have several different queues for passing messages between tiers. Initially, I was planning to use multiple direct exchanges, with one for each message type, but it looks like having a single…
Mun
  • 14,098
  • 11
  • 59
  • 83
31
votes
2 answers

Why do we need routing key in RabbitMQ?

Why do we need routing key to route messages from exchange to queue? Can't we simply use the queue name to route the message? Also, in case of publishing to multiple queues, we can use multiple queue names. Can anyone point out the scenario where we…
Naresh
  • 5,073
  • 12
  • 67
  • 124
27
votes
3 answers

RabbitMQ Declare Exchange from Terminal - Access refused: /api/exchanges/

I'm using rabbitmq to handle messages between my databases for an enterprise application I work on. As part of the process, I'm trying to help automate the setup of the servers (e.g. script it). In this process, I've tried to use rabbitmqadmin to…
James Oravec
  • 19,579
  • 27
  • 94
  • 160
24
votes
6 answers

Rabbit mq - Error while waiting for Mnesia tables

I have installed rabbitmq using helm chart on a kubernetes cluster. The rabbitmq pod keeps restarting. On inspecting the pod logs I get the below error 2020-02-26 04:42:31.582 [warning] <0.314.0> Error while waiting for Mnesia tables:…
20
votes
1 answer

multiple Rabbitmq queues with spring boot

From spring boot tutorial: https://spring.io/guides/gs/messaging-rabbitmq/ They give an example of creating 1 queue and 1 queue only, but, what if I want to be able to create more then 1 queue? how would it be possible? Obviously, I can't just…
winter
  • 2,687
  • 4
  • 18
  • 27
15
votes
1 answer

RabbitMQ: Scaling queues with the consistent hash exchange

(Picking up from a Github Issue) We use RabbitMQ's consistent hash exchange which is useful to shard routing keys from an exchange to multiple queues. We use the queues to dish out work to workers. Ideally we would like to dynamically scale these…
Andy Smith
  • 3,308
  • 4
  • 26
  • 34
11
votes
2 answers

Trouble with RabbitMQ fanout exchange

I am able to create a fanout exchange using the Publish/Subscribe RabbitMQ Java tutorial, and any connected consumer will receive a copy of a message. Instead of declaring an exchange and binding dynamically/programmatically, I would like to create…
littleK
  • 19,521
  • 30
  • 128
  • 188
10
votes
0 answers

Message sequence acting unexpectedly in RabbitMQ

I'd like to implement a RabbitMQ topology similar to Option 3 here, except for some differences: The new topology should handle a few 1000 messages per day. And it shall have two exchanges: one to deal with the main queues (about 30), the other to…
pymat
  • 1,090
  • 1
  • 23
  • 45
10
votes
3 answers

Publish message using exchange and routing key using MassTransit

I've been looking at MassTransit for a couple of weeks now and I'm curious about the possibilities. However, I don't seem to be able to get the concepts quite right. Expected behaviour I wanted to publish message to "direct" exchange with routing…
Syed
  • 417
  • 1
  • 6
  • 13
9
votes
2 answers

Rabbitmq File Descriptor Limit

Rabbitmq documentation says that we need to do some configuration before we use it on production. One of the configuration is about maximum open file number (which is an OS parameter). Rabbitmq server we use is running on Ubuntu 16.04 and according…
faruk.kuscan
  • 499
  • 1
  • 6
  • 19
8
votes
1 answer

Making sure a message published on a topic exchange is received by at least one consumer

TLDR; In the context of a topic exchange and queues created on the fly by the consumers, how to have a message redelivered / the producer notified when no consumer consumes the message? I have the following components: a main service, producing…
8
votes
1 answer

How to use php-amqplib rabbitMQ on web browser

I am trying to use php-amqplib for sending and receiving message. It works sending/receiving on terminal. But When go for web browser, unable to receive from queue it continuously waits for message. I used below code for…
Prak
  • 815
  • 7
  • 18
8
votes
2 answers

RabbitMQ mirroring queues and exchanges

Is it possible to use federations or shovels to mirror the creation of exchanges and queues on one server to another ? All the examples I've seen of using shovels and federations use exchanges and queues that already exist on the servers. What I…
user1450877
  • 421
  • 5
  • 16
7
votes
1 answer

RabbitMQ - access to vhost 'XXX' refused for user 'guest'

I am using RabbitMQ 3.0.3 version. The service was working fine for last 4-5 years. Recently some updates patches were installed on the server and the Service stopped responding. This is what is happening: The RabbitMQ service (windows service) is…
SharpCoder
  • 18,279
  • 43
  • 153
  • 249
1
2 3
27 28