Examples of Partitioning


Examples of org.apache.activemq.partition.dto.Partitioning

    public void testCreatePartitionBroker() throws Exception {

        BrokerService broker = BrokerFactory.createBroker("xbean:activemq-partition.xml");
        assertEquals(1, broker.getPlugins().length);
        PartitionBrokerPlugin plugin = (PartitionBrokerPlugin)broker.getPlugins()[0];
        Partitioning config = plugin.getConfig();
        assertEquals(2,  config.getBrokers().size());

        Object o;
        String json = "{\n" +
        "  \"by_client_id\":{\n" +
        "    \"client1\":{\"ids\":[\"broker1\"]},\n" +
        "    \"client2\":{\"ids\":[\"broker1\",\"broker2\"]}\n" +
        "  },\n" +
        "  \"brokers\":{\n" +
        "    \"broker1\":\"tcp://localhost:61616\",\n" +
        "    \"broker2\":\"tcp://localhost:61616\"\n" +
        "  }\n" +
        "}";
        Partitioning expected = Partitioning.MAPPER.readValue(json, Partitioning.class);
        assertEquals(expected.toString(), config.toString());

    }
View Full Code Here

Examples of org.apache.activemq.partition.dto.Partitioning

        }
        return null;
    }

    protected Target getTarget(ActiveMQDestination dest) {
        Partitioning config = getConfig();
        if( dest.isQueue() && config.byQueue !=null && !config.byQueue.isEmpty() ) {
            return config.byQueue.get(dest.getPhysicalName());
        } else if( dest.isTopic() && config.byTopic !=null && !config.byTopic.isEmpty() ) {
            return config.byTopic.get(dest.getPhysicalName());
        }
View Full Code Here

Examples of org.apache.activemq.partition.dto.Partitioning

    protected ArrayList<Connection> connections = new ArrayList<Connection>();
    Partitioning partitioning;

    @Before
    public void setUp() throws Exception {
        partitioning = new Partitioning();
        partitioning.brokers = new HashMap<String, String>();
    }
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.