title: Multi tenant Rabbit MQ application using spring boot
body: <p>I am in need of implementing a multi tenant MQ (Rabbit MQ) application using spring boot and  spring integration. Having seen the javadocs, I assume AbstractRoutingConnectionFactory would suffice my requirement. But I am curious to know the usage of thread-bound context to determine the lookup for the target.</p>
  
  <p>javadoc of AbstractRoutingConnectionFactory</p>
  
  <blockquote>
    <p>Abstract {@link ConnectionFactory} implementation that routes {@link #createConnection()}
    calls to one of various target ConnectionFactories based on a lookup key. The latter is usually
    (but not necessarily) determined through some thread-bound context.</p>
  </blockquote>
  
  <p>I am trying to understand more on the abstractRouting that spring offers. Below is what I am trying to understand</p>
  
  <ol>
  <li><p>Wouldn't a hashmap suffice the purpose of the lookup. I am trying to
  understand what advantage does the thread bound context brings in
  abstract routing ?</p></li>
  <li><p>What advantages does the AbstractRoutingConnectionFactory brings in
      specific, since the same could be achieved using a simple if-else
      logic to determine the target from the hashmap?</p></li>
  </ol>