Examples of PolicyMap


Examples of org.apache.activemq.broker.region.policy.PolicyMap

        entry.setProducerFlowControl(false);
        entry.setMemoryLimit(10485760);
        entry.setPendingQueuePolicy(new FilePendingQueueMessageStoragePolicy());
        policyEntries.add(entry);

        final PolicyMap policyMap = new PolicyMap();
        policyMap.setPolicyEntries(policyEntries);
        broker.setDestinationPolicy(policyMap);
    }
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.PolicyMap

        super.tearDown();
    }

    protected BrokerService createBroker() throws Exception {
        BrokerService answer = super.createBroker();
        PolicyMap policyMap = new PolicyMap();
        PolicyEntry defaultEntry = new PolicyEntry();
        // ensure prefetch is exact. only delivery next when current is acked
        defaultEntry.setUsePrefetchExtension(false);
        policyMap.setDefaultEntry(defaultEntry);
        answer.setDestinationPolicy(policyMap);
        return answer;
    }
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.PolicyMap

        PolicyEntry policy = new PolicyEntry();
        policy.setPrioritizedMessages(true);
        policy.setMaxPageSize(500);

        PolicyMap policyMap = new PolicyMap();
        policyMap.setDefaultEntry(policy);
        brokerService.setDestinationPolicy(policyMap);
        setDefaultPersistenceAdapter(brokerService);

        return brokerService;
    }
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.PolicyMap

        StorePendingDurableSubscriberMessageStoragePolicy durableSubPending =
                new StorePendingDurableSubscriberMessageStoragePolicy();
        durableSubPending.setImmediatePriorityDispatch(immediatePriorityDispatch);
        durableSubPending.setUseCache(useCache);
        policy.setPendingDurableSubscriberPolicy(durableSubPending);
        PolicyMap policyMap = new PolicyMap();
        policyMap.put(new ActiveMQQueue("TEST"), policy);
        policyMap.put(new ActiveMQTopic("TEST"), policy);

        // do not process expired for one test
        PolicyEntry ignoreExpired = new PolicyEntry();
        SharedDeadLetterStrategy ignoreExpiredStrategy = new SharedDeadLetterStrategy();
        ignoreExpiredStrategy.setProcessExpired(false);
        ignoreExpired.setDeadLetterStrategy(ignoreExpiredStrategy);
        policyMap.put(new ActiveMQTopic("TEST_CLEANUP_NO_PRIORITY"), ignoreExpired);

        broker.setDestinationPolicy(policyMap);
        broker.start();
        broker.waitUntilStarted();
       
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.PolicyMap

        broker.setPersistent(false);
        broker.setUseJmx(false);
        broker.setSchedulePeriodForDestinationPurge(1000);
        broker.setAllowTempAutoCreationOnSend(true);

        PolicyMap map = new PolicyMap();
        PolicyEntry tempReplyQPolicy = new PolicyEntry();
        tempReplyQPolicy.setOptimizedDispatch(true);
        tempReplyQPolicy.setGcInactiveDestinations(true);
        tempReplyQPolicy.setGcWithNetworkConsumers(true);
        tempReplyQPolicy.setInactiveTimoutBeforeGC(1000);
        map.put(replyQWildcard, tempReplyQPolicy);
        broker.setDestinationPolicy(map);

        broker.addConnector("tcp://localhost:0");
        brokers.add(broker);
        return broker;
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.PolicyMap

        defaultPolicy.setQueue(">");
        defaultPolicy.setOptimizedDispatch(true);
        defaultPolicy.setDeadLetterStrategy(strategy);
        defaultPolicy.setMemoryLimit(9000000);

        PolicyMap policyMap = new PolicyMap();
        policyMap.setDefaultEntry(defaultPolicy);

        broker.setDestinationPolicy(policyMap);

        broker.getSystemUsage().getMemoryUsage().setLimit(300000000L);
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.PolicyMap

        broker.setBrokerName("localhost");
        broker.setUseJmx(true);
        broker.setDeleteAllMessagesOnStartup(true);
        broker.addConnector("tcp://localhost:0");

        PolicyMap policyMap = new PolicyMap();
        PolicyEntry defaultEntry = new PolicyEntry();
        defaultEntry.setOptimizedDispatch(optimizedDispatch);
        defaultEntry.setExpireMessagesPeriod(expireMessagesPeriod);
        defaultEntry.setMaxExpirePageSize(800);

        defaultEntry.setPendingQueuePolicy(pendingQueuePolicy);

        if (memoryLimit) {
            // so memory is not consumed by DLQ turn if off
            defaultEntry.setDeadLetterStrategy(null);
            defaultEntry.setMemoryLimit(200 * 1000);
        }

        policyMap.setDefaultEntry(defaultEntry);

        broker.setDestinationPolicy(policyMap);
        broker.start();
        broker.waitUntilStarted();

View Full Code Here

Examples of org.apache.activemq.broker.region.policy.PolicyMap

        Integer prefetchVal = new Integer(150);
        PolicyEntry policyEntry = new PolicyEntry();
        policyEntry.setDurableTopicPrefetch(prefetchVal.intValue());
        policyEntry.setPrioritizedMessages(true);
        PolicyMap policyMap = new PolicyMap();
        policyMap.setDefaultEntry(policyEntry);
        broker.setDestinationPolicy(policyMap);
        broker.start();

        factory = createConnectionFactory();
        Connection consumerConnection = factory.createConnection();
View Full Code Here

Examples of org.apache.activemq.broker.region.policy.PolicyMap

        setDefaultPersistenceAdapter(broker);
        broker.getSystemUsage().getMemoryUsage().setLimit((30 * 16 * 1024));

        PolicyEntry defaultPolicy = new PolicyEntry();
        defaultPolicy.setOptimizedDispatch(true);
        PolicyMap policyMap = new PolicyMap();
        policyMap.setDefaultEntry(defaultPolicy);
        broker.setDestinationPolicy(policyMap);

        broker.addConnector("tcp://localhost:0");
        broker.start();

View Full Code Here

Examples of org.apache.activemq.broker.region.policy.PolicyMap

        entry.setInactiveTimoutBeforeGC(2000);
        entry.setProducerFlowControl(true);
        entry.setAdvisoryForConsumed(true);
        entry.setAdvisdoryForFastProducers(true);
        entry.setAdvisoryForDelivery(true);
        PolicyMap map = new PolicyMap();
        map.setDefaultEntry(entry);

        MirroredQueue mirrorQ = new MirroredQueue();
        mirrorQ.setCopyMessage(true);
        DestinationInterceptor[] destinationInterceptors = new DestinationInterceptor[]{mirrorQ};
        answer.setDestinationInterceptors(destinationInterceptors);
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.