Package org.apache.activemq.pool

Examples of org.apache.activemq.pool.PooledConnectionFactory


        factory.setServiceClass(Greeter.class);
        factory.setAddress("jms://");

        JMSConfiguration jmsConfig = new JMSConfiguration();
        ConnectionFactory connectionFactory
            = new PooledConnectionFactory(broker.getBrokerURL());
        jmsConfig.setConnectionFactory(connectionFactory);
        jmsConfig.setTargetDestination("greeter.queue.noaop");
        jmsConfig.setPubSubDomain(false);
        jmsConfig.setUseJms11(true);
View Full Code Here


public class JMSFlow extends AbstractJMSFlow {

    private PooledConnectionFactory factory;

    protected ConnectionFactory createConnectionFactoryFromUrl(String jmsURL) {
        factory = (jmsURL != null) ? new PooledConnectionFactory(jmsURL) : new PooledConnectionFactory();
        return factory;
    }
View Full Code Here

    protected void createJmsConnectionFactory() throws Exception {
        connectionFactory = new ActiveMQConnectionFactory("vm://localhost");
    }

    protected void createJmsTemplate() throws Exception {
        jmsTemplate = new JmsTemplate(new PooledConnectionFactory(connectionFactory));
    }
View Full Code Here

* @org.apache.xbean.XBean element="jmsFlow"
*/
public class JMSFlow extends AbstractJMSFlow {

    protected ConnectionFactory createConnectionFactoryFromUrl(String jmsURL) {
        return (jmsURL != null) ? new PooledConnectionFactory(jmsURL) : new PooledConnectionFactory();
    }
View Full Code Here

        ActiveMQConnectionFactory cf1 = new ActiveMQConnectionFactory(brokerURI);
        RedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
        redeliveryPolicy.setMaximumRedeliveries(1);
        redeliveryPolicy.setInitialRedeliveryDelay(1000);
        cf1.setRedeliveryPolicy(redeliveryPolicy());
        cf = new PooledConnectionFactory(cf1);
        cff = new ConnectionFactoryFeature(cf);
    }
View Full Code Here

    public synchronized CamelContext getCamelContext() {
      if (camelContext == null) {
        LOG.debug("Creating camel context");
        camelContext = new DefaultCamelContext();
        ActiveMQConfiguration conf = new ActiveMQConfiguration();
        conf.setConnectionFactory(new PooledConnectionFactory((ActiveMQConnectionFactory)factory));
        ActiveMQComponent component = new ActiveMQComponent(conf);
        camelContext.addComponent("activemq", component);
      }
      return camelContext;
    }
View Full Code Here

    public synchronized CamelContext getCamelContext() {
      if (camelContext == null) {
        LOG.debug("Creating camel context");
        camelContext = new DefaultCamelContext();
        ActiveMQConfiguration conf = new ActiveMQConfiguration();
        conf.setConnectionFactory(new PooledConnectionFactory((ActiveMQConnectionFactory)factory));
        ActiveMQComponent component = new ActiveMQComponent(conf);
        camelContext.addComponent("activemq", component);
      }
      return camelContext;
    }
View Full Code Here

    public synchronized CamelContext getCamelContext() {
      if (camelContext == null) {
        LOG.debug("Creating camel context");
        camelContext = new DefaultCamelContext();
        ActiveMQConfiguration conf = new ActiveMQConfiguration();
        conf.setConnectionFactory(new PooledConnectionFactory((ActiveMQConnectionFactory)factory));
        ActiveMQComponent component = new ActiveMQComponent(conf);
        camelContext.addComponent("activemq", component);
      }
      return camelContext;
    }
View Full Code Here

     * @return a newly created JmsTemplate
     */
    protected JmsTemplate createJmsTemplate() {
        if (usePooledConnectionWithTemplate) {
            // lets use a pool to avoid creating and closing producers
            return new JmsTemplate(new PooledConnectionFactory(bindAddress));
        }
        else {
            return new JmsTemplate(connectionFactory);
        }
    }
View Full Code Here

        container.activateComponent(component, "servicemix-jms");
        Thread.sleep(500);
        container.start();

        JmsTemplate jmsTemplate = new JmsTemplate();
        jmsTemplate.setConnectionFactory(new PooledConnectionFactory(connectionFactory));
        jmsTemplate.setPubSubDomain(true);
        jmsTemplate.afterPropertiesSet();
        jmsTemplate.convertAndSend("destinationTopic", "<hello>world</hello>");
        receiver.getMessageList().assertMessagesReceived(1);
        Thread.sleep(500);
View Full Code Here

TOP

Related Classes of org.apache.activemq.pool.PooledConnectionFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.