Examples of ActiveMQPrefetchPolicy


Examples of org.activemq.ActiveMQPrefetchPolicy


        List networkConnectors = container.getNetworkConnectors();
        assertEquals("Should have a single network connector", 1, networkConnectors.size());
        NetworkConnector networkConnector = (NetworkConnector) networkConnectors.get(0);
        ActiveMQPrefetchPolicy localPrefetchPolicy = networkConnector.getLocalPrefetchPolicy();
        assertNotNull("localPrefetchPolicy", localPrefetchPolicy);
        assertEquals("localPrefetchPolicy.getQueuePrefetch", 1, localPrefetchPolicy.getQueuePrefetch());
        assertEquals("localPrefetchPolicy.getQueueBrowserPrefetch", 2, localPrefetchPolicy.getQueueBrowserPrefetch());

        ActiveMQPrefetchPolicy remotePrefetchPolicy = networkConnector.getRemotePrefetchPolicy();
        assertNotNull("remotePrefetchPolicy", remotePrefetchPolicy);
        assertEquals("remotePrefetchPolicy.getTopicPrefetch", 3, remotePrefetchPolicy.getTopicPrefetch());
        assertEquals("remotePrefetchPolicy.getDurableTopicPrefetch", 4, remotePrefetchPolicy.getDurableTopicPrefetch());


        List networkChannels = networkConnector.getNetworkChannels();
        assertEquals("Should have 2 network channels", 2, networkChannels.size());
View Full Code Here

Examples of org.apache.activemq.ActiveMQPrefetchPolicy

        broker.setDestinationPolicy(policyMap);
        broker.start();
        broker.waitUntilStarted();
       
        factory = new ActiveMQConnectionFactory("vm://priorityTest");
        ActiveMQPrefetchPolicy prefetch = new ActiveMQPrefetchPolicy();
        prefetch.setAll(prefetchVal);
        factory.setPrefetchPolicy(prefetch);
        factory.setWatchTopicAdvisories(false);
        factory.setDispatchAsync(dispatchAsync);
        conn = factory.createConnection();
        conn.setClientID("priority");
View Full Code Here

Examples of org.apache.activemq.ActiveMQPrefetchPolicy

               
        Topic advisoryTopic = AdvisorySupport.getMessageDiscardedAdvisoryTopic((ActiveMQDestination) topic);
        MessageConsumer advisoryConsumer = s.createConsumer(advisoryTopic);
        //start throwing messages at the consumer
        MessageProducer producer = s.createProducer(topic);
        int count = (new ActiveMQPrefetchPolicy().getTopicPrefetch() * 2);
        for (int i = 0; i < count; i++) {
            BytesMessage m = s.createBytesMessage();
            producer.send(m);
        }
               
View Full Code Here

Examples of org.apache.activemq.ActiveMQPrefetchPolicy

     * Returns the prefetch policy; not using bean properties to avoid breaking
     * compatibility with JCA configuration in J2EE
     */
    public ActiveMQPrefetchPolicy prefetchPolicy() {
        if (prefetchPolicy == null) {
            prefetchPolicy = new ActiveMQPrefetchPolicy();
        }
        return prefetchPolicy;
    }
View Full Code Here

Examples of org.apache.activemq.ActiveMQPrefetchPolicy

        return broker;
    }

    protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
        ActiveMQConnectionFactory result = super.createConnectionFactory(bindAddress);
        ActiveMQPrefetchPolicy policy = new ActiveMQPrefetchPolicy();
        policy.setTopicPrefetch(1000);
        result.setPrefetchPolicy(policy);
        return result;
    }
View Full Code Here

Examples of org.apache.activemq.ActiveMQPrefetchPolicy

    }

    protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(
            broker.getTransportConnectors().get(0).getPublishableConnectString());
        ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy();
        prefetchPolicy.setAll(1);
        factory.setPrefetchPolicy(prefetchPolicy);

        factory.setDispatchAsync(true);
        return factory;
    }
View Full Code Here

Examples of org.apache.activemq.ActiveMQPrefetchPolicy

        broker.setDestinationPolicy(policyMap);
        broker.start();
        broker.waitUntilStarted();
       
        factory = new ActiveMQConnectionFactory("vm://priorityTest");
        ActiveMQPrefetchPolicy prefetch = new ActiveMQPrefetchPolicy();
        prefetch.setAll(prefetchVal);
        factory.setPrefetchPolicy(prefetch);
        factory.setWatchTopicAdvisories(false);
        factory.setDispatchAsync(dispatchAsync);
        conn = factory.createConnection();
        conn.setClientID("priority");
View Full Code Here

Examples of org.apache.activemq.ActiveMQPrefetchPolicy

    }

    public void testHighPriorityDelivery() throws Exception {

        // get zero prefetch
        ActiveMQPrefetchPolicy prefetch = new ActiveMQPrefetchPolicy();
        prefetch.setAll(0);
        factory.setPrefetchPolicy(prefetch);
        conn.close();
        conn = factory.createConnection();
        conn.setClientID("priority");
        conn.start();
View Full Code Here

Examples of org.apache.activemq.ActiveMQPrefetchPolicy

    }

    public void testHighPriorityDeliveryInterleaved() throws Exception {

        // get zero prefetch
        ActiveMQPrefetchPolicy prefetch = new ActiveMQPrefetchPolicy();
        prefetch.setAll(0);
        factory.setPrefetchPolicy(prefetch);
        conn.close();
        conn = factory.createConnection();
        conn.setClientID("priority");
        conn.start();
View Full Code Here

Examples of org.apache.activemq.ActiveMQPrefetchPolicy

    }

    public void testHighPriorityDeliveryThroughBackLog() throws Exception {

        // get zero prefetch
        ActiveMQPrefetchPolicy prefetch = new ActiveMQPrefetchPolicy();
        prefetch.setAll(0);
        factory.setPrefetchPolicy(prefetch);
        conn.close();
        conn = factory.createConnection();
        conn.setClientID("priority");
        conn.start();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.