Federated RabbitMQ -- Duplicate Message

222 views
Skip to first unread message

Renz Santos

unread,
Mar 9, 2021, 10:06:48 AM3/9/21
to rabbitmq-users
Hi --

I'm currently running two instances of rabbitmq in region1 and region2 that are bi-directionally federated to each other. I have a federation exchange policy and a federation queue policy setup. I'm only using a single exchange (topic type and durable) in both regions which is federated to the other based on the policy. I also have worker queues that are federated based on the federation queue policy. 

In my setup, I started a worker queue on region1 and another worker queue on region2 which are federated to each other with bindings being the exact same. If I send a message to the worker queue on region2, the region2 worker queue Consumer processes the message, but the same message also gets process on region1 Consumer (which I don't want) because the federated exchange replicates the message. 

The reason I have a federation exchange and queue policy is because for broadcast queues I want messages receive via federation exchange and for worker queues I want messages receive via federation queue.

Is there a way to tell rabbitmq to not replicate the message in a federated exchange if the message target (routing key) is for a federated queue?

Renz Santos

unread,
Mar 9, 2021, 11:28:00 AM3/9/21
to rabbitmq-users
Adding more info:

I'm using RabbitMQ version 3.8.9. Here's the docker compose to setup two rabbitmq systems (which I'm defining as region1 and region2). 


version: "3.4"
services:
  rabbitmq1:
    image: rabbitmq:3-management
    ports:
      - "5672:5672"
      - "15672:15672"
    container_name: rabbitmq1
    hostname: rabbitmq1
    volumes:
      - rabbit1volume:/var/lib/rabbitmq/mnesia
      - ./config/enabled_plugins:/etc/rabbitmq/enabled_plugins
      - ./config/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf

  rabbitmq2:
    image: rabbitmq:3-management
    ports:
      - "5673:5672"
      - "15673:15672"
    container_name: rabbitmq2
    hostname: rabbitmq2
    volumes:
      - rabbit2volume:/var/lib/rabbitmq/mnesia
      - ./config/enabled_plugins:/etc/rabbitmq/enabled_plugins
      - ./config/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
volumes:
  rabbit1volume:
  rabbit2volume:

Here's my federation policies setup for exchange and queue on both rabbitmq's. I tried adding a priorities to the policy but that doesn't seem to be use for publishing messages.
Capture.PNG     Capture1.PNG

Here's the upstream status of both.
Capture2.PNG
Capture3.PNG

Here's the exchange setup for both and showing the fed-exchange policy:
Capture5.PNG Capture6.PNG

And here's the queue setup for both showing the fed-queue-policy:
Capture7.PNG
Capture8.PNG

Capture9.PNG
Capture10.PNG

Any ideas/help is greatly appreciated.


Reply all
Reply to author
Forward
0 new messages