JMS Connections
A JMS Connection object represents the connection that a JMS client has to its JMS provider, representing an open TCP/IP socket between the client and the JMS provider. Care must be taken to close a JMS Connection when it is no longer required within the JMS client application. Invoking the close method on a Connection object results in the close method being called on all of the objects created from it.
The creation of the Connection object is also the point at which the JMS client authenticates itself with the JMS provider. If no credentials are specified, then the identity of the user under which the JMS client is running is used.
Connection objects support concurrent use.
ConnectionFactory objects are used to create instances of Connection objects. The connection interfaces include...
Common interface Domain-specific interfaces
Point-to-Point Publish/Subscribe Connection QueueConnection TopicConnection The code required to create a JMS Connection object...
// User credentials String userID = "jmsClient"; String password = "password"; // Create the connection, specifying no credentials Connection conn1 = connFactory.createConnection(); // Create connection, specifying credentials Connection conn2 = connFactory.createConnection(userID, password);