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

How to abort code when publish message on non exist queue in rabbitmq

I have wrote server-client application. Server Side server will initilise a queue queue1 with routing key key1 on direct exchange. After initilise and declaration it consume data whenever someone write on it. Client Side client will publish some…
Chintan Patel
  • 173
  • 3
  • 14
4
votes
2 answers

Scenarios where to use which type of exchange(direct, fanout, topic, headers) in RabbitMQ?

I am not able to figure out the actual scenarios of using different exchange types provided in RabbitMQ.
Badal
  • 376
  • 4
  • 11
4
votes
2 answers

To consume a rabbitmq queue, do I really need to declare the exchange and the queue?

In all the examples I find online, I see the exchange and the queue being declared before a messages are consumed. Declaring the exchange seems weird, because, why would I do it? I'm consuming a queue, which might be bound to multiple exchanges (or…
polo
  • 1,352
  • 2
  • 16
  • 35
4
votes
2 answers

How to attach erlang dbg to a running process?

How could I attach a debugger to a running erlang process (rabbitmq)? I have the source code of the same rabbit version that's running. I would like to set a breakpoint on a source line, and attach a debugger to the running rabbit instance. I'm not…
polo
  • 1,352
  • 2
  • 16
  • 35
4
votes
1 answer

Is there a limit to the number of exchanges for rabbitmq?

Could not find anything about this in either the docs or on google, except that it should be bound to the available resources of the server. Does anyone have experience with really large numbers of exchanges at a time in a working environment? Just…
maxigs
  • 866
  • 6
  • 16
3
votes
2 answers

Rabbitmq giving segmentation fault on M1 mac

env.conf" /opt/homebrew/opt/rabbitmq/sbin/rabbitmq-server /opt/homebrew/opt/rabbitmq/sbin/rabbitmq-server: line 155: 1332 Segmentation fault: 11 start_rabbitmq_server "$@" I am getting this error^ I tried reinstalling rabbitmq. I cannot find a…
Arkham007
  • 111
  • 1
  • 1
  • 8
3
votes
1 answer

RabbitMQ Error while pushing a message to queue

I am trying to push a JSON message to the RabbitMQ queue using a message exchange. I have installed RabbitMQ through a docker. I have create and started a docker container using the following: docker run -d --hostname myrabbit --name…
Utkarsh
  • 31
  • 2
3
votes
1 answer

Consume high volume (streaming) message from RabbitMQ

I am building an application to Consume high volume (streaming) message from RabbitMQ. Following is the situation There is RabbitMQ where publisher is publishing Live Match data which means volume of data is very fast( 100 messges per second per…
Rupesh
  • 545
  • 2
  • 8
  • 19
3
votes
2 answers

DeliverCallback deliverCallback = (consumerTag, delivery) function not getting called

I am trying to retrieve response from a rabbitmq queue, on the first go with the same code, I was able to retrieve the response correctly but whenever I run it the second or third time it does not call the delivercallback function where I am trying…
codeBlues
  • 31
  • 2
3
votes
2 answers

Allow RabbitMQ and Pika maintain the conection always open

I've a Python script which reads stuff from a stream, and when a new string gets readed, it pushes its content (a string) to a RabbitMQ queue. The thing is that the stream might not send messages in 1, 2 or 9h or so, so I would like to have the…
Avión
  • 7,963
  • 11
  • 64
  • 105
3
votes
2 answers

How to - purge a rabbitmq queue using curl

I am checking is there way to purge a rabbitmq queue using curl ? I know using command line, but I am in need of something using curl? Suggestions/help appreciated Note : - with this link , I did not get exact curl command to be used
Vishwa
  • 607
  • 2
  • 11
  • 21
3
votes
1 answer

keep order of delivery after requeue

I'm developing an application for messaging using Rabbit MQ. I use explicit ACK: model.BasicConsume(queueName,false, consumer); and do ACK after processing message: consumer.Received += (ch, ea) => { try …
Timur Lemeshko
  • 2,747
  • 5
  • 27
  • 39
3
votes
2 answers

How to publish Json using rabbitmqadmin command

I want to publish Json message using rabbitmqadmin command line. How can we do that as i was reading we can send only string message in payload like below rabbitmqadmin publish exchange=default routing_key=test payload="hello, world". But I wanted…
3
votes
1 answer

How to aggregate RabbitMq messages into single message by correlation ID

Let's say that I have a pipeline of commands that need to be executed sequentially and that some of the commands contain multiple operations that should be executed in parallel (same correlation id). And let's assume that I need to know when all…
Ivan Davidov
  • 823
  • 1
  • 9
  • 24
3
votes
0 answers

Route dead letter messages with headers exchange

I like to route my dead letter messages into dlx queues according to the original queue name. My setup: The dead letter message looks like this { "payload_bytes": 44, "redelivered": true, "exchange": "dlx", "routing_key":…
nickel715
  • 2,505
  • 1
  • 23
  • 28