Package org.apache.activemq.broker.region

Examples of org.apache.activemq.broker.region.Topic


    public void testBrokerConfiguredCorrectly() throws Exception {

        // Validate the system properties are being evaluated in xbean.
        assertEquals("testbroker", brokerService.getBrokerName());

        Topic topic = (Topic)broker.addDestination(context, new ActiveMQTopic("FOO.BAR"),true);
        DispatchPolicy dispatchPolicy = topic.getDispatchPolicy();
        assertTrue("dispatchPolicy should be RoundRobinDispatchPolicy: " + dispatchPolicy, dispatchPolicy instanceof RoundRobinDispatchPolicy);

        SubscriptionRecoveryPolicy subscriptionRecoveryPolicy = topic.getSubscriptionRecoveryPolicy();
        assertTrue("subscriptionRecoveryPolicy should be LastImageSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                   subscriptionRecoveryPolicy instanceof LastImageSubscriptionRecoveryPolicy);

        LOG.info("destination: " + topic);
        LOG.info("dispatchPolicy: " + dispatchPolicy);
        LOG.info("subscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy);

        topic = (Topic)broker.addDestination(context, new ActiveMQTopic("ORDERS.BOOKS"),true);
        dispatchPolicy = topic.getDispatchPolicy();
        assertTrue("dispatchPolicy should be StrictOrderDispatchPolicy: " + dispatchPolicy, dispatchPolicy instanceof StrictOrderDispatchPolicy);

        subscriptionRecoveryPolicy = topic.getSubscriptionRecoveryPolicy();
        assertTrue("subscriptionRecoveryPolicy should be TimedSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                   subscriptionRecoveryPolicy instanceof TimedSubscriptionRecoveryPolicy);
        TimedSubscriptionRecoveryPolicy timedSubcriptionPolicy = (TimedSubscriptionRecoveryPolicy)subscriptionRecoveryPolicy;
        assertEquals("getRecoverDuration()", 60000, timedSubcriptionPolicy.getRecoverDuration());
View Full Code Here


    public void testBrokerConfiguredCorrectly() throws Exception {

        // Validate the system properties are being evaluated in xbean.
        assertEquals("testbroker", brokerService.getBrokerName());

        Topic topic = (Topic) broker.addDestination(context, new ActiveMQTopic("FOO.BAR"));
        DispatchPolicy dispatchPolicy = topic.getDispatchPolicy();
        assertTrue("dispatchPolicy should be RoundRobinDispatchPolicy: " + dispatchPolicy, dispatchPolicy instanceof RoundRobinDispatchPolicy);
       
        SubscriptionRecoveryPolicy subscriptionRecoveryPolicy = topic.getSubscriptionRecoveryPolicy();
        assertTrue("subscriptionRecoveryPolicy should be LastImageSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                subscriptionRecoveryPolicy instanceof LastImageSubscriptionRecoveryPolicy);
       
        log.info("destination: " + topic);
        log.info("dispatchPolicy: " + dispatchPolicy);
        log.info("subscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy);

        topic = (Topic) broker.addDestination(context, new ActiveMQTopic("ORDERS.BOOKS"));
        dispatchPolicy = topic.getDispatchPolicy();
        assertTrue("dispatchPolicy should be StrictOrderDispatchPolicy: " + dispatchPolicy, dispatchPolicy instanceof StrictOrderDispatchPolicy);

        subscriptionRecoveryPolicy = topic.getSubscriptionRecoveryPolicy();
        assertTrue("subscriptionRecoveryPolicy should be TimedSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                subscriptionRecoveryPolicy instanceof TimedSubscriptionRecoveryPolicy);
        TimedSubscriptionRecoveryPolicy timedSubcriptionPolicy = (TimedSubscriptionRecoveryPolicy) subscriptionRecoveryPolicy;
        assertEquals("getRecoverDuration()", 60000, timedSubcriptionPolicy.getRecoverDuration());
       
View Full Code Here

    public void testBrokerConfiguredCorrectly() throws Exception {

        // Validate the system properties are being evaluated in xbean.
        assertEquals("testbroker", brokerService.getBrokerName());

        Topic topic = (Topic)broker.addDestination(context, new ActiveMQTopic("FOO.BAR"),true);
        DispatchPolicy dispatchPolicy = topic.getDispatchPolicy();
        assertTrue("dispatchPolicy should be RoundRobinDispatchPolicy: " + dispatchPolicy, dispatchPolicy instanceof RoundRobinDispatchPolicy);

        SubscriptionRecoveryPolicy subscriptionRecoveryPolicy = topic.getSubscriptionRecoveryPolicy();
        assertTrue("subscriptionRecoveryPolicy should be LastImageSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                   subscriptionRecoveryPolicy instanceof LastImageSubscriptionRecoveryPolicy);

        LOG.info("destination: " + topic);
        LOG.info("dispatchPolicy: " + dispatchPolicy);
        LOG.info("subscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy);

        topic = (Topic)broker.addDestination(context, new ActiveMQTopic("ORDERS.BOOKS"),true);
        dispatchPolicy = topic.getDispatchPolicy();
        assertTrue("dispatchPolicy should be StrictOrderDispatchPolicy: " + dispatchPolicy, dispatchPolicy instanceof StrictOrderDispatchPolicy);

        subscriptionRecoveryPolicy = topic.getSubscriptionRecoveryPolicy();
        assertTrue("subscriptionRecoveryPolicy should be TimedSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                   subscriptionRecoveryPolicy instanceof TimedSubscriptionRecoveryPolicy);
        TimedSubscriptionRecoveryPolicy timedSubscriptionPolicy = (TimedSubscriptionRecoveryPolicy)subscriptionRecoveryPolicy;
        assertEquals("getRecoverDuration()", 60000, timedSubscriptionPolicy.getRecoverDuration());
View Full Code Here

    public void testBrokerConfiguredCorrectly() throws Exception {

        // Validate the system properties are being evaluated in xbean.
        assertEquals("testbroker", brokerService.getBrokerName());

        Topic topic = (Topic)broker.addDestination(context, new ActiveMQTopic("FOO.BAR"),true);
        DispatchPolicy dispatchPolicy = topic.getDispatchPolicy();
        assertTrue("dispatchPolicy should be RoundRobinDispatchPolicy: " + dispatchPolicy, dispatchPolicy instanceof RoundRobinDispatchPolicy);

        SubscriptionRecoveryPolicy subscriptionRecoveryPolicy = topic.getSubscriptionRecoveryPolicy();
        assertTrue("subscriptionRecoveryPolicy should be LastImageSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                   subscriptionRecoveryPolicy instanceof LastImageSubscriptionRecoveryPolicy);

        LOG.info("destination: " + topic);
        LOG.info("dispatchPolicy: " + dispatchPolicy);
        LOG.info("subscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy);

        topic = (Topic)broker.addDestination(context, new ActiveMQTopic("ORDERS.BOOKS"),true);
        dispatchPolicy = topic.getDispatchPolicy();
        assertTrue("dispatchPolicy should be StrictOrderDispatchPolicy: " + dispatchPolicy, dispatchPolicy instanceof StrictOrderDispatchPolicy);

        subscriptionRecoveryPolicy = topic.getSubscriptionRecoveryPolicy();
        assertTrue("subscriptionRecoveryPolicy should be TimedSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                   subscriptionRecoveryPolicy instanceof TimedSubscriptionRecoveryPolicy);
        TimedSubscriptionRecoveryPolicy timedSubcriptionPolicy = (TimedSubscriptionRecoveryPolicy)subscriptionRecoveryPolicy;
        assertEquals("getRecoverDuration()", 60000, timedSubcriptionPolicy.getRecoverDuration());
View Full Code Here

    public void testBrokerConfiguredCorrectly() throws Exception {

        // Validate the system properties are being evaluated in xbean.
        assertEquals("testbroker", brokerService.getBrokerName());

        Topic topic = (Topic)broker.addDestination(context, new ActiveMQTopic("FOO.BAR"));
        DispatchPolicy dispatchPolicy = topic.getDispatchPolicy();
        assertTrue("dispatchPolicy should be RoundRobinDispatchPolicy: " + dispatchPolicy, dispatchPolicy instanceof RoundRobinDispatchPolicy);

        SubscriptionRecoveryPolicy subscriptionRecoveryPolicy = topic.getSubscriptionRecoveryPolicy();
        assertTrue("subscriptionRecoveryPolicy should be LastImageSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                   subscriptionRecoveryPolicy instanceof LastImageSubscriptionRecoveryPolicy);

        LOG.info("destination: " + topic);
        LOG.info("dispatchPolicy: " + dispatchPolicy);
        LOG.info("subscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy);

        topic = (Topic)broker.addDestination(context, new ActiveMQTopic("ORDERS.BOOKS"));
        dispatchPolicy = topic.getDispatchPolicy();
        assertTrue("dispatchPolicy should be StrictOrderDispatchPolicy: " + dispatchPolicy, dispatchPolicy instanceof StrictOrderDispatchPolicy);

        subscriptionRecoveryPolicy = topic.getSubscriptionRecoveryPolicy();
        assertTrue("subscriptionRecoveryPolicy should be TimedSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                   subscriptionRecoveryPolicy instanceof TimedSubscriptionRecoveryPolicy);
        TimedSubscriptionRecoveryPolicy timedSubcriptionPolicy = (TimedSubscriptionRecoveryPolicy)subscriptionRecoveryPolicy;
        assertEquals("getRecoverDuration()", 60000, timedSubcriptionPolicy.getRecoverDuration());
View Full Code Here

    public void testBrokerConfiguredCorrectly() throws Exception {

        // Validate the system properties are being evaluated in xbean.
        assertEquals("testbroker", brokerService.getBrokerName());

        Topic topic = (Topic)broker.addDestination(context, new ActiveMQTopic("FOO.BAR"),true);
        DispatchPolicy dispatchPolicy = topic.getDispatchPolicy();
        assertTrue("dispatchPolicy should be RoundRobinDispatchPolicy: " + dispatchPolicy, dispatchPolicy instanceof RoundRobinDispatchPolicy);

        SubscriptionRecoveryPolicy subscriptionRecoveryPolicy = topic.getSubscriptionRecoveryPolicy();
        subscriptionRecoveryPolicy = ((RetainedMessageSubscriptionRecoveryPolicy)subscriptionRecoveryPolicy).getWrapped();

        assertTrue("subscriptionRecoveryPolicy should be LastImageSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                   subscriptionRecoveryPolicy instanceof LastImageSubscriptionRecoveryPolicy);

        LOG.info("destination: " + topic);
        LOG.info("dispatchPolicy: " + dispatchPolicy);
        LOG.info("subscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy);

        topic = (Topic)broker.addDestination(context, new ActiveMQTopic("ORDERS.BOOKS"),true);
        dispatchPolicy = topic.getDispatchPolicy();
        assertTrue("dispatchPolicy should be StrictOrderDispatchPolicy: " + dispatchPolicy, dispatchPolicy instanceof StrictOrderDispatchPolicy);

        subscriptionRecoveryPolicy = topic.getSubscriptionRecoveryPolicy();
        subscriptionRecoveryPolicy = ((RetainedMessageSubscriptionRecoveryPolicy)subscriptionRecoveryPolicy).getWrapped();
        assertTrue("subscriptionRecoveryPolicy should be TimedSubscriptionRecoveryPolicy: " + subscriptionRecoveryPolicy,
                   subscriptionRecoveryPolicy instanceof TimedSubscriptionRecoveryPolicy);
        TimedSubscriptionRecoveryPolicy timedSubscriptionPolicy = (TimedSubscriptionRecoveryPolicy)subscriptionRecoveryPolicy;
        assertEquals("getRecoverDuration()", 60000, timedSubscriptionPolicy.getRecoverDuration());
View Full Code Here

            for (Destination virtualDest : virtualDests) {
                if (virtualDest.getActiveMQDestination().isTopic() &&
                    (virtualDest.isAlwaysRetroactive() || sub.getConsumerInfo().isRetroactive())) {

                    Topic topic = (Topic) getBaseDestination(virtualDest);
                    if (topic != null) {
                        // re-use browse() to get recovered messages
                        final Message[] messages = topic.getSubscriptionRecoveryPolicy().browse(topic.getActiveMQDestination());

                        // add recovered messages to subscription
                        for (Message message : messages) {
                            final Message copy = message.copy();
                            copy.setOriginalDestination(message.getDestination());
View Full Code Here

TOP

Related Classes of org.apache.activemq.broker.region.Topic

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.