title: How to connect to RabbitMQ using RabbitMQ JMS client from an existing JMS application?
body: <p>I have a generic standalone JMS application which works with following JMS providers WebSphere, HornetQ and ActiveMq. I pass Context.INITIAL_CONTEXT_FACTORY and Context.PROVIDER_URL as parameters to my application and create a naming context out of them by doing something like this </p>
  
  <pre><code>Properties environmentParameters = new Properties();
  environmentParameters.put(Context.INITIAL_CONTEXT_FACTORY, property.context);
  environmentParameters.put(Context.PROVIDER_URL, property.provider);
  namingContext = new InitialContext(environmentParameters);
  </code></pre>
  
  <p>And use this context for object lookup. </p>
  
  <p>I understand RabbitMQ isn't a JMS provider so it doesn't have an InitialContext class or a Provider URL but it provides a JMS Client which is an abstraction of its Java client conforming to JMS specification. RabbitMQ's JMS client <a href="http://rabbitmq.docs.pivotal.io/doc/34/topics/install-jms-client.html">documentation</a> has an example of defining objects in JNDI as a resource configuration as part of a web application but I quite couldn't figure out how to do something similar for my standalone application which creates a naming context based on JNDI provider using JMS client's dependencies or to create an InitialContext out of the available dependencies. </p>
  
  <p>So can someone throw some light on how this can be done? Hope my question is clear. </p>