# JMS Instantiate Connection Factory Example

    To run the example, simply type mvn verify from this directory,
    or mvn -PnoServer verify if you want to start and create the server manually.

Usually, JMS Objects such as ConnectionFactories, Queue and Topic instances are looked up from JNDI before being used by the client code. This objects are called "administered objects" in JMS specification terminology.

However, in some cases a JNDI server may not be available or desired. To come to the rescue ActiveMQ also supports the direct instantiation of these administered objects on the client side.

This allows the full set of JMS functionality to be available without requiring a JNDI server!

This example is very simple and based on the simple Queue example, however in this example we instantiate the JMS Queue and ConnectionFactory objects directly.

A wide variety of methods are available for instantiating ConnectionFactory objects. In this example we use a simple method which just takes the server connection details so it knows where to make the connection to.

Other methods are available so all the connection factory parameters can be specified including specifying UDP discovery so the client does not need hard-wired knowledge of where the servers are that it wishes to connect to, or for specifying live-backup pairs of servers for failover.

For more information on instantiating ConnectionFactories directly please consult the user manual and javadoc.