Package org.axonframework.eventhandling.amqp

Examples of org.axonframework.eventhandling.amqp.DefaultAMQPConsumerConfiguration


    }

    @Test
    public void testTwoClustersForSingleQueue() {
        testSubject.registerCluster(new SimpleCluster("cluster1"),
                                    new DefaultAMQPConsumerConfiguration("Queue1"),
                                    new DefaultAMQPMessageConverter(serializer));
        assertEquals(1, containersCreated.size());
        Object messageListener = containersCreated.get(0).getMessageListener();
        verify((ClusterMessageListener) messageListener, never()).addCluster(isA(SimpleCluster.class));
        testSubject.registerCluster(new SimpleCluster("cluster2"),
                                    new DefaultAMQPConsumerConfiguration("Queue1"),
                                    new DefaultAMQPMessageConverter(serializer));

        assertTrue(messageListener instanceof ClusterMessageListener);
        // the first cluster is added in the constructor
        verify((ClusterMessageListener) messageListener, times(1)).addCluster(isA(SimpleCluster.class));
View Full Code Here


    }

    @Test
    public void testTwoClustersForDifferentQueues() {
        testSubject.registerCluster(new SimpleCluster("cluster1"),
                                    new DefaultAMQPConsumerConfiguration("Queue1"),
                                    new DefaultAMQPMessageConverter(serializer));
        assertEquals(1, containersCreated.size());
        Object messageListener1 = containersCreated.get(0).getMessageListener();

        testSubject.registerCluster(new SimpleCluster("cluster2"),
                                    new DefaultAMQPConsumerConfiguration("Queue2"),
                                    new DefaultAMQPMessageConverter(serializer));

        assertEquals(2, containersCreated.size());
        Object messageListener2 = containersCreated.get(1).getMessageListener();
View Full Code Here

    }

    @Test
    public void testLifecycleOperationsPropagatedToAllListeners() throws Exception {
        testSubject.registerCluster(new SimpleCluster("cluster1"),
                                    new DefaultAMQPConsumerConfiguration("Queue1"),
                                    new DefaultAMQPMessageConverter(serializer));
        testSubject.registerCluster(new SimpleCluster("cluster2"),
                                    new DefaultAMQPConsumerConfiguration("Queue2"),
                                    new DefaultAMQPMessageConverter(serializer));

        assertEquals(2, containersCreated.size());
        SimpleMessageListenerContainer container1 = containersCreated.get(0);
        SimpleMessageListenerContainer container2 = containersCreated.get(1);
View Full Code Here

    }

    @Test
    public void testContainerManagerIsRunningIfAtLeastOneContainerIsRunning() throws Exception {
        testSubject.registerCluster(new SimpleCluster("cluster1"),
                                    new DefaultAMQPConsumerConfiguration("Queue1"),
                                    new DefaultAMQPMessageConverter(serializer));
        testSubject.registerCluster(new SimpleCluster("cluster2"),
                                    new DefaultAMQPConsumerConfiguration("Queue2"),
                                    new DefaultAMQPMessageConverter(serializer));

        testSubject.start();
        assertTrue(testSubject.isRunning());
View Full Code Here

    }

    @Test(expected = AxonConfigurationException.class)
    public void testClusterIsRejectedIfNoQueueSpecified() {
        testSubject.registerCluster(new SimpleCluster("cluster1"),
                                    new DefaultAMQPConsumerConfiguration(null),
                                    new DefaultAMQPMessageConverter(serializer));
    }
View Full Code Here

    }

    @Test
    public void testClusterIsCreatedAfterContainerStart() {
        testSubject.registerCluster(new SimpleCluster("cluster1"),
                                    new DefaultAMQPConsumerConfiguration("Queue1"),
                                    new DefaultAMQPMessageConverter(serializer));
        assertEquals(1, containersCreated.size());
        Object messageListener = containersCreated.get(0).getMessageListener();
        verify((ClusterMessageListener) messageListener, never()).addCluster(isA(SimpleCluster.class));
        testSubject.start();
        testSubject.registerCluster(new SimpleCluster("cluster2"),
                                    new DefaultAMQPConsumerConfiguration("Queue1"),
                                    new DefaultAMQPMessageConverter(serializer));

        assertTrue(messageListener instanceof ClusterMessageListener);
        // the first cluster is added in the constructor
        verify((ClusterMessageListener) messageListener, times(1)).addCluster(isA(SimpleCluster.class));
View Full Code Here

        ClusterMetaData clusterMetaData = cluster.getMetaData();
        AMQPConsumerConfiguration config;
        if (clusterMetaData.getProperty(AMQP_CONFIG_PROPERTY) instanceof AMQPConsumerConfiguration) {
            config = (AMQPConsumerConfiguration) clusterMetaData.getProperty(AMQP_CONFIG_PROPERTY);
        } else {
            config = new DefaultAMQPConsumerConfiguration(cluster.getName());
        }
        getListenerContainerLifecycleManager().registerCluster(cluster, config, messageConverter);
    }
View Full Code Here

TOP

Related Classes of org.axonframework.eventhandling.amqp.DefaultAMQPConsumerConfiguration

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.