Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9011293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:41:29+00:00 2026-06-16T02:41:29+00:00

I want to use HAProxy as a load balancer. I want to put two

  • 0

I want to use HAProxy as a load balancer. I want to put two rabbitmq server behind haproxy. Both the rabbitmq server are on different instance of EC2. I have configure HAProxy server by following this reference. I works but the problem is messages are not published in roundrobin pattern. Messages are publish only on one server. Is there any different configuration for my requirement?

My configureation in /etc/haproxy/haproxy.cfg

listen rabbitmq 0.0.0.0:5672
     mode    tcp
     stats   enable
     balance roundrobin
    option tcplog
    no  option clitcpka
    no option srvtcpka
     server  rabbit01 46.XX.XX.XX:5672 check
     server  rabbit02 176.XX.XX.XX:5672 check
listen  web-service *:80
          mode    http
         balance roundrobin
        option httpchk HEAD / HTTP/1.0
         option httpclose
        option forwardfor
        option httpchk OPTIONS /health_check.html
        stats enable
        stats refresh 10s
        stats hide-version
        stats scope   .
        stats uri     /lb?stats
        stats realm   LB2\ Statistics
        stats auth    admin:Adm1nn

Update:

I have made some R&D on this and found that HAProxy is round robin the connection on the rabbitmq server. for ex: if i request for 10 connections then it will round robin the 10 connection over my 2 rabbitmq servers and publish the message.

But the problem is I want to round robin the messages, not connection it should be manage by HAProxy server. i.e if i send 1000 msg at a time to HAProxy then 500 msg should go to rabbit server1 and 500 msg should go to rabbit server2. What should be the configuration that i have to follow?

Update:

I have also test with leastconn in balancing but HAProxy behavior in unexpected. I have posted that question on serverfault.com

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T02:41:30+00:00Added an answer on June 16, 2026 at 2:41 am

    Messages get published to an exchange which will route to a queue.

    You probably didn’t configure you queues with {“x-ha-policy”,”all”}. Based on the fact that the exchange routing is working on both nodes this is probably all you are missing.

    Note: Pre Rabbit 3.0 you would declare a queue with the x-ha-policy argument and it would be mirrored. With rabbit 3.0 you need to apply a policy (ha-mode = all). You can set policies through the api or the api tools (rabbitmqctl, management gui). i.e.

    rabbitmqctl set_policy -p '/' MirrorAllQueues '.+' '{"ha-mode": "all"}'

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We use Stunnel (to strip out SSL) and HAProxy on our Load Balancer -
I want use two functions with recurrence in the same time, and I have
i want use some data from a website with web service. i have a
We have a powerbuilder application and we want use a scanner through this application
I want use the VennDiagram package to correlate three different variables. But in R
I want use a Redis server with a PHP Site hosted on a MediaTemple
I want to use private drawable from android. for that i have downloade androi-8.jar
I want use ORDER BY RAND() query mysql. But I have some question want
I want use RedCloth gem, i install it, in my gemfile i put ->
I want use a jQuery plugin in category.tpl. Put files in javascript/jquery directory. Now,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.