Announcement Announcement Module
Collapse
No announcement yet.
How to connect to master / slave rabbitmq Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to connect to master / slave rabbitmq

    We have have two rabbit mq , one acting as a failover. Currently the way i connect is i create two separate connectionFactories

    <bean id="listener1" class="org.springframework.amqp.rabbit.listener.Si mpleMessageListenerContainer" init-method="doStart">
    <property name="connectionFactory" ref="host1ConnectionFactory"/>
    <property name="queueName" value="${tdb.rabbit.queue_name}"/>
    <property name="messageListener" ref="listenerAdapter"/>
    </bean>

    <bean id="listener2" class="org.springframework.amqp.rabbit.listener.Si mpleMessageListenerContainer" init-method="doStart">
    <property name="connectionFactory" ref="host2ConnectionFactory"/>
    <property name="queueName" value="${tdb.rabbit.queue_name}"/>
    <property name="messageListener" ref="listenerAdapter"/>
    </bean>

    Like this.

    Is there a way to get around this and just use one listener?

  • #2
    Do either of these planned issues seem relevant?:
    https://jira.springsource.org/browse/AMQP-44
    https://jira.springsource.org/browse/AMQP-45

    Comment


    • #3
      RE: How to connect to master / slave rabbitmq

      https://jira.springsource.org/browse/AMQP-45

      more looks like the related feature. I looked at AbstractRoutingDataSource , I was more looking at an interface like this

      new XXXConnectionFactory(List<ServerAddress>)

      address could be host,port,username,password,vhost

      The factory/connection should internally deal with failover. If address1 is down the request should always be delegated to the other addresses


      https://jira.springsource.org/browse/AMQP-44 is also a feature that I will definitely wait for


      Thanks,
      Suresh

      Comment


      • #4
        Have you looked into clustering of the RabbitMQ broker itself?

        Comment


        • #5
          I am just a newbie to rabbitmq the person who set the exchange up says that it doesn't support VIP so was told to connect to two seperate servers

          Suresh

          Comment

          Working...
          X