Package org.apache.activemq.broker.region.policy

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


        BrokerService service = new BrokerService();
        service.setPersistent(false);
        service.setUseJmx(true);
       
        // Setup a destination policy where it takes only 1 message at a time.
        PolicyMap policyMap = new PolicyMap();       
        PolicyEntry policy = new PolicyEntry();
        policy.setMemoryLimit(1);       
        policyMap.setDefaultEntry(policy);       
        service.setDestinationPolicy(policyMap);
       
        connector = service.addConnector("tcp://localhost:0");       
        return service;
    }
View Full Code Here


        BrokerService broker = super.createBroker();

        PolicyEntry policy = new PolicyEntry();
        policy.setDispatchPolicy(new SimpleDispatchPolicy());

        PolicyMap pMap = new PolicyMap();
        pMap.setDefaultEntry(policy);

        broker.setDestinationPolicy(pMap);

        return broker;
    }
View Full Code Here

        BrokerService broker = super.createBroker();

        PolicyEntry policy = new PolicyEntry();
        policy.setSendAdvisoryIfNoConsumers(true);

        PolicyMap pMap = new PolicyMap();
        pMap.setDefaultEntry(policy);

        broker.setDestinationPolicy(pMap);

        return broker;
    }
View Full Code Here

        BrokerService broker = super.createBroker();

        PolicyEntry policy = new PolicyEntry();
        policy.setDispatchPolicy(new StrictOrderDispatchPolicy());

        PolicyMap pMap = new PolicyMap();
        pMap.setDefaultEntry(policy);

        broker.setDestinationPolicy(pMap);

        return broker;
    }
View Full Code Here

        BrokerService broker = super.createBroker();

        PolicyEntry policy = new PolicyEntry();
        policy.setDispatchPolicy(new RoundRobinDispatchPolicy());

        PolicyMap pMap = new PolicyMap();
        pMap.setDefaultEntry(policy);

        broker.setDestinationPolicy(pMap);

        return broker;
    }
View Full Code Here

      tcpConnector = broker.addConnector(uri);

      PolicyEntry policy = new PolicyEntry();
      policy.setDeadLetterStrategy(new SharedDeadLetterStrategy());

      PolicyMap pMap = new PolicyMap();
      pMap.setDefaultEntry(policy);

      broker.setDestinationPolicy(pMap);

      return broker;
    } finally {
View Full Code Here

      }
      broker.setUseJmx(useJmx);
      PolicyEntry policy = new PolicyEntry();
      policy.setDeadLetterStrategy(new SharedDeadLetterStrategy());

      PolicyMap pMap = new PolicyMap();
      pMap.setDefaultEntry(policy);

      broker.setDestinationPolicy(pMap);
      broker.setPersistenceAdapter(new MemoryPersistenceAdapter());
      broker.setPersistent(false);
      broker.setUseShutdownHook(true);
View Full Code Here

        answer.setPersistent(false);
        answer.setDeleteAllMessagesOnStartup(true);
        answer.setUseJmx(true);
      
        // apply memory limit so that %usage is visible
        PolicyMap policyMap = new PolicyMap();
        PolicyEntry defaultEntry = new PolicyEntry();
        defaultEntry.setMemoryLimit(1024*1024*4);
        policyMap.setDefaultEntry(defaultEntry);
        answer.setDestinationPolicy(policyMap);
       
        answer.addConnector(bindAddress);
        return answer;
    }
View Full Code Here

        // will get lots of duplicates
        // real problem is sync between cursor and store add - leads to out or order messages
        // in the cursor so setBatch can break.
        // policy.setUseCache(false);
       
        PolicyMap pMap = new PolicyMap();
        pMap.setDefaultEntry(policy);
        answer.setDestinationPolicy(pMap);
        answer.setDeleteAllMessagesOnStartup(true);
        answer.addConnector(bindAddress);

        MemoryUsage memoryUsage = new MemoryUsage();
View Full Code Here

        slave.setUseJmx(false);
       
        // Setup a destination policy where it takes lots of message at a time.
        // so that slave does not block first as there is no producer flow control
        // on the master connector
        PolicyMap policyMap = new PolicyMap();
        PolicyEntry policy = new PolicyEntry();
        // don't apply the same memory limit as the master in this case
        //policy.setMemoryLimit(10);
        policy.setPendingSubscriberPolicy(new VMPendingSubscriberMessageStoragePolicy());
        policy.setPendingQueuePolicy(new VMPendingQueueMessageStoragePolicy());
        policy.setProducerFlowControl(true);
        policyMap.setDefaultEntry(policy);
       
        slave.setDestinationPolicy(policyMap);
        slave.setMasterConnectorURI(connector.getConnectUri().toString());
        slave.start();
        return service;
View Full Code Here

TOP

Related Classes of org.apache.activemq.broker.region.policy.PolicyMap

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.