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

Load balancing for RabbitMQ server (broker), not the consumers(clients)

In this example I have a setup of 2 consumers and 2 publishers in my network. The centre is a RabbitMQ broker as shown in the screenshot below. Due to fail-safe reasons, I am wondering if RabbitMQ supports load-balancing or mirroring of the server…
1
vote
2 answers

Rabbit mq detect there is no producer in consumers code

I have a rabbitmq setup with a producer and many consumers. What would the best practice way to tell the consumers that the producer isn't able to send due to crash or some other failure? In case of a failure in the producer I'd like to notify and…
user5326354
1
vote
0 answers

RabbitMq REST HTTP : Send integer values in JSON payload

data types of headersI am trying to send a message directly to Exchange using the REST endpoint: /api/exchanges/vhost/name/publish The sample payload I am using is: { "properties": { "timestamp": 1536959503, "message_id": "100", …
user10382123
1
vote
0 answers

rabbitmq federated exchange for scalability

Is it possible to use rabbitmq federated exchange for scalability as explained below: The messages would be published by the application on multiple upstream exchanges working behind a load balancer. These messages published to upstream exchanges…
1
vote
1 answer

Configuring 'amq.rabbitmq.event' exchange to a different vhost?

I am configuring RabbitMQ with the rabbitmq_event_exchange plugin. I am using this plugin to listen to RabbitMQ events. By default, the plugin is creating an exchange named 'amq.rabbitmq.event' in the default vhost(/) . But, I am trying to change…
Vimal David
  • 555
  • 2
  • 7
  • 20
1
vote
0 answers

Rabbit-mq multiple-queues, same consumer, share load

!(https://image.ibb.co/jXgPRy/stackoverflow.jpg) I'm trying to achieve this using rabbitmq queues and exchanges. Direct queues with routing keys just fanout to queues with same routing key. What i am trying to acheieve is more of load balancing and…
1
vote
1 answer

RabbitMQ block other consumers during consumption

Is there way for queue to wait till a task/message/item is completed in processing before it sends the next task/message/item to another consumer? This is the scenario I am trying to accomplish: Three consumers (cons_A, cons_B, cons_C) subscribe to…
ozn
  • 1,990
  • 3
  • 26
  • 37
1
vote
2 answers

RabbitMQ Headers Exchange where X-Match equals any

Can someone explain why this is happening? I have created a headers exchange and bound it to three queues with different arguments as following: Then I try to publish a message where any queue with format: pdf would receive it, like this: But the…
1
vote
1 answer

How do I monitor RabbitMQ exchange lifecycle events

I'm working with a product suite which uses RabbitMQ as a back end for service bus messaging. Many of the clients use software (NeuronESB) which is supposed to automatically configure exchanges, queues and channels as needed. Somewhere in the system…
psaxton
  • 1,693
  • 19
  • 24
1
vote
0 answers

How to check how many rabbitMQ consumers are currently available and running

I am using Java as the rabbitMq consumer for processing my input from the Node JS server. I am running 4 threads of same consumers on the Java to process 4 inputs parallel. If there was a 5th message received by the consumer it waits for current…
Soorya Prakash
  • 921
  • 3
  • 9
  • 29
1
vote
0 answers

Is it a good practice to use alternate exchange in RabbitMQ as dead letter exchange?

I know that RabbitMQ has alternative and dead letter exchange types. Since we don't have mapped queues for some message, from my perspective it is some kind of problem when we don't know what the message is. In this case we use alternative exchange…
Dmytro Melnychuk
  • 2,285
  • 21
  • 23
1
vote
0 answers

RabbitMQ listener configuration - Unable to consume messages from Queue

I am having a problem in consuming messages from a queue. I have defined a listener but for some reason I am not able to consume any messages. I put breakpoints in the onMessage function but they never get hit. Here is my code files. Not sure what…
sirajnadwar
  • 237
  • 2
  • 6
  • 13
1
vote
2 answers

Purging retained MQTT last will messages from RabbitMQ?

I manage a RabbitMQ broker with MQTT and WebSocket MQTT enabled. While testing the servers, we unintentionally marked a client's last will and testament as retain = true. This had unintended consequences, such as always receiving the LWT message…
Rick
  • 8,366
  • 8
  • 47
  • 76
1
vote
1 answer

GEtting Error in Pyspark communication through RPC in RabbitMq

I am newly using RabbitMq for pyspark communication from remote pc through RPC.For testing purpose i have developed a test code which is giving me the error I have followed RabbitMq doc tutorial for implementing RPC over pyspark Here is my…
Kalyan
  • 1,880
  • 11
  • 35
  • 62
1
vote
1 answer

RabbitMQ delayed message not working

I am trying to use delayed exchange plugin, but somehow its not working for me and message are received without delay. I tried following things : a) enabled rabbitmq_delayed_message_exchange successfully and restarted rabbitmq server on…
Rajat Goyal
  • 465
  • 1
  • 5
  • 20