title: How to define multiple rabbit:template in Spring XML?
body: <p>I defined two rabbit:template in spring xml:</p>
  
  <pre><code>&lt;bean id="application.startup.status" class="org.springframework.amqp.remoting.client.AmqpProxyFactoryBean"&gt;
     &lt;property name="serviceInterface" value="com.xxx.services.IStartupStatusService"/&gt;
     &lt;property name="amqpTemplate" ref="rmqTemplate_application_startup_status"/&gt;
  &lt;/bean&gt;
  
  &lt;rabbit:template id="rmqTemplate_application_startup_status" connection-factory="rmqConnectionFactory" reply-timeout="2000"
     routing-key="remoting.application_startup_status"
     exchange="remoting.exchange.application_startup_status"/&gt;
  
  &lt;rabbit:queue name="application_startup_status" /&gt;
  
  &lt;rabbit:direct-exchange name="remoting.exchange.application_startup_status"&gt;
     &lt;rabbit:bindings&gt;
          &lt;rabbit:binding queue="application_startup_status" key="remoting.application_startup_status" /&gt;
     &lt;/rabbit:bindings&gt;
  &lt;/rabbit:direct-exchange&gt;
  
  &lt;bean id="application.root.status" class="org.springframework.amqp.remoting.client.AmqpProxyFactoryBean"&gt;
    &lt;property name="serviceInterface" value="com.xxx.services.IRootStatusService"/&gt;
     &lt;property name="amqpTemplate" ref="rmqTemplate_application_root_status"/&gt;
  &lt;/bean&gt;
  
  &lt;rabbit:template id="rmqTemplate_application_root_status" connection-factory="rmqConnectionFactory" reply-timeout="2000"
      routing-key="remoting.application_root_status"     
      exchange="remoting.exchange.application_root_status"/&gt;
  
  &lt;rabbit:queue name="application_root_status" /&gt;
  
  &lt;rabbit:direct-exchange name="remoting.exchange.application_root_status"&gt;
     &lt;rabbit:bindings&gt;
       &lt;rabbit:binding queue="application_root_status" key="remoting.application_root_status" /&gt;
      &lt;/rabbit:bindings&gt;
  &lt;/rabbit:direct-exchange&gt;
  </code></pre>
  
  <p>when run my application, there is error :</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.springframework.amqp.rabbit.core.RabbitTemplate' available: expected single matching bean but found 3: rmqTemplate_application_startup_status, rmqTemplate_application_root_status
  </code></pre>
  
  <p>I write this Spring XML following the sample in page <a href="http://docs.spring.io/spring-amqp/reference/htmlsingle/#remoting" rel="nofollow noreferrer">http://docs.spring.io/spring-amqp/reference/htmlsingle/#remoting</a>. How to resolve this issue?</p>