Creating and using connection factories
It is the job of the connection factory that encapsulates the connection's parameters to cre-
ate new JMS connections. A connection factory is bound to the Java Naming Directory
Index ( JNDI ) and can be looked up by both local and remote clients, provided they supply
the correct environment parameters. Since a connection factory can be reused multiple
times in your code, it's the kind of object that can be conveniently cached by a remote cli-
ent or a message-driven bean.
The definition of connection-factory instances is included in the full and full-ha serv-
er configurations. You can choose either of the server configurations using the -c com-
mand argument, for instance, standalone.bat -c standalone-full.xml . We
will cover the configuration profiles in depth in Chapter 9 , Managing the Application Serv-
er . For now, just remember to start your server with the full configuration profile whenever
you need JMS.
You can inspect the connection factories in the overall JMS configuration, which is avail-
able by surfing the admin console and navigating to Configuration | Messaging Destina-
tions | Connection Factories , as shown in the following screenshot: