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

Spring-boot-starter RabbitMQ global error handling

I am using spring-boot-starter-amqp 1.4.2.Producer and consumer working fine but sometimes the incoming JSON messages have an incorrect syntax. This results in the following (correct)…
VelNaga
  • 3,593
  • 6
  • 48
  • 82
7
votes
1 answer

Multiple acknowledge for the same delivery tag

In my project I saw that there is a chance of acknowledging the same delivery tag twice. When this happens, the consumer gets unbound from the queue and no further messages come to the consumer (Observed using the RabbitMQ management dashboard). How…
syodage
  • 386
  • 1
  • 4
  • 12
7
votes
2 answers

RabbitMq : Create queue dynamically

I have a scenario where I want to publish some messages to rabbitmq-exchange using a specific routing key for eg. abc The issue is there may already be any queue already binded with routing key "abc" or may be not. The behavior for such scenarios…
Rahul
  • 15,979
  • 4
  • 42
  • 63
6
votes
1 answer

Docker - RabbitMQ.Client.Exceptions.BrokerUnreachableException: 'None of the specified endpoints were reachable'

I have set up RabbitMQ server on my dev machine using this docker image. I have used below command to setup my container docker run -d --name my-rabbit -p 5672:15672 rabbitmq:3-management Below is docker ps command output CONTAINER ID IMAGE…
user2243747
  • 2,767
  • 6
  • 41
  • 61
6
votes
1 answer

How to create an exchange using rabbitmqctl

rabbitmqctl have the subcommand list_exchanges to list all the exchanges. How can I create an exchange using rabbitmqctl, as I didn't see the add_exchanges subcommands?
user1744416
  • 171
  • 1
  • 12
6
votes
2 answers

RabbitMQ back up messages in specific queue

I have a service that consumes messages from a RabbitMQ queue (posting to the queue is done through a topic exchange). Assuming that the service can theoretically fail and lose its state, possibility to back up all the messages for disaster recovery…
Sergey Evstifeev
  • 4,941
  • 2
  • 24
  • 28
5
votes
1 answer

Topic Exchange with Celery and RabbitMQ

I'm a bit confused on what my configuration should look like to set up a topic exchange. http://www.rabbitmq.com/tutorials/tutorial-five-python.html This is what I'd like to accomplish: Task1 -> send to QueueOne and QueueFirehose Task2 -> sent to…
brianz
  • 7,268
  • 4
  • 37
  • 44
5
votes
1 answer

RabbitMQ delayed message when there is an exception

I'm using the plugin (https://blog.rabbitmq.com/posts/2015/04/scheduling-messages-with-rabbitmq) and it works well. I send a message with X seconds of delay, and it's processed with X seconds of delay. The problem is in the process logic. If it…
abullor
  • 51
  • 4
5
votes
2 answers

RabbitMQ dead letter exchange - route by "x-death.reason" or "x-first-death-reason" header

I am trying to set up RabbitMQ to route messages through a Dead Letter Exchange based on the death reason (either "x-death.reason" or "x-first-death-reason" would do). My understanding is that when a message dies that "x-death.reason" and…
Greg Bacchus
  • 2,235
  • 2
  • 23
  • 26
5
votes
1 answer

How to use rabbitMQ as a broker for celery within a Django unittest

I am writing an integration test where I am creating a rabbitMQ container using - docker run -d --hostname localhost -p 5672:5672 --name rabbit-tox -e RABBITMQ_DEFAULT_USER=guest -e RABBITMQ_DEFAULT_PASS=guest rabbitmq:3 To test if I can connect…
Groot221
  • 71
  • 1
  • 5
5
votes
2 answers

RabbitMQ consumer overload

I`ve been reading about the principles of AMQP messaging confirms. (https://www.rabbitmq.com/confirms.html). Really helpful and wel written article but one particular thing about consumer aknowledgments is really confusing, here is the…
Sivich
  • 51
  • 1
  • 5
5
votes
0 answers

Client unexpectedly closed TCP connection

I have a couple of tasks running as a service. To kick off the worker I use: def SvcDoRun(self): logging.info('Starting {name} service ...'.format(name=self._svc_name_)) os.chdir(INSTDIR) # so that proj worker can be found …
user0187409
  • 239
  • 1
  • 4
  • 13
5
votes
1 answer

Can I bind a queue from a different vhost?

I have an exchange with a vhost, user, etc from that exchange I bind different queues. The exchange and the queues are in the same vhost. Now I want to create a different vhost for a different queue but I cannot bind this new queue from the previous…
Danilo
  • 199
  • 1
  • 2
  • 12
5
votes
1 answer

RabbitMq : Is there a way to apply policy on all virtual host in cluster environment for queue mirroring?

In RabbitMQ, If I want to mirror queue in cluster environment I use below command : rabbitmqctl set_policy ha-all "" '{"ha-mode":"all","ha-sync-mode":"automatic"}' This command will apply policy to all queues of virtual host "\". If I have to apply…
5
votes
1 answer

How to specify additional info on a rabbit message when it's dead lettered

I have a rabbit queue with messages for consuming. I also have a listener that can fail. The queue is configured with a dead letter exchange (along with a dead letter queue). What I want is to see an exception info in the messages sitting in the…
Ruslan
  • 3,063
  • 1
  • 19
  • 28
1
2
3
27 28