* @return Connection - broker connection.
*/
private static Connection createConnectionFactory(String url,
boolean embeddedBroker) throws JMSException {
//Used to create a session from the default MQ server ActiveMQConnectionFactory.
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(url);
if (embeddedBroker) {
factory.setUseEmbeddedBroker(true);
}
factory.setTurboBoost(true);
ActiveMQConnection c = (ActiveMQConnection) factory.createConnection();
c.getPrefetchPolicy().setQueuePrefetch(1000);
c.getPrefetchPolicy().setQueueBrowserPrefetch(1000);
c.getPrefetchPolicy().setTopicPrefetch(1000);
c.getPrefetchPolicy().setDurableTopicPrefetch(1000);