...
The createConnection()
method
This method instantiates a ConnectionFactory
object with an ActiveMQConnectionFactory
object and creates a Connection
object through the factory method createConnection()
.
The ActiveMQConnectionFactory
object has to be instantiated with the URL of the MQ server.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
public Connection createConnection(String uri){
factory = new ActiveMQConnectionFactory(uri);
Connection jmsConnection = null;
try {
jmsConnection = factory.createConnection();
} catch (JMSException e) {
spooler_log.error("JMSException occurred while trying to connect: ");
throw e;
}
return jmsConnection;
} |
Excerpt Include
Implementation of the Producer Job
...