Results 1 to 5 of 5

Thread: How to connect to master / slave rabbitmq

  1. #1
    Join Date
    Sep 2010
    Posts
    22

    Default 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. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,844

  3. #3
    Join Date
    Sep 2010
    Posts
    22

    Default 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

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,844

    Default

    Have you looked into clustering of the RabbitMQ broker itself?

  5. #5
    Join Date
    Sep 2010
    Posts
    22

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •