Package org.apache.hedwig.server.integration.TestHedwigHub

Examples of org.apache.hedwig.server.integration.TestHedwigHub.TestMessageHandler


        // Start delivery for the local subscribers in all regions
        for (HedwigClient client : regionClientsMap.values()) {
            for (int i = 0; i < batchSize; i++) {
                client.getSubscriber().startDelivery(ByteString.copyFromUtf8("Topic" + i),
                                                     ByteString.copyFromUtf8("LocalSubscriber"), new TestMessageHandler(consumeQueue));
            }
        }

        // Now start publishing messages for the subscribed topics in one of the
        // regions and verify that it gets delivered and consumed in all of the
View Full Code Here


        // Start delivery for the local subscribers in all regions
        for (HedwigClient client : regionClientsMap.values()) {
            for (int i = 0; i < batchSize; i++) {
                client.getSubscriber().startDelivery(ByteString.copyFromUtf8("Topic" + i),
                                                     ByteString.copyFromUtf8("LocalSubscriber"), new TestMessageHandler(consumeQueue));
            }
        }

        // Now start publishing messages for the subscribed topics in one of the
        // regions and verify that it gets delivered and consumed in all of the
View Full Code Here

        // Start delivery for local subscribers in all regions
        for (Map.Entry<String, HedwigClient> entry : regionClientsMap.entrySet()) {
            HedwigClient client = entry.getValue();
            for (int i = 0; i < batchSize; i++) {
                client.getSubscriber().startDelivery(ByteString.copyFromUtf8("Topic" + i),
                                                     ByteString.copyFromUtf8("LocalSubscriber"), new TestMessageHandler(consumeQueue));
            }
        }

        // Now start publishing messages for the subscribed topics in one of the
        // regions and verify that it gets delivered and consumed in all of the
View Full Code Here

        // Start delivery for local subscribers in all regions
        for (Map.Entry<String, HedwigClient> entry : regionClientsMap.entrySet()) {
            HedwigClient client = entry.getValue();
            for (int i = 0; i < batchSize; i++) {
                client.getSubscriber().startDelivery(ByteString.copyFromUtf8("Topic" + i),
                                                     ByteString.copyFromUtf8("LocalSubscriber"), new TestMessageHandler(consumeQueue));
            }
        }

        // start region again
        startRegion(regionId);
        // wait for retry
        Thread.sleep(3 * TEST_RETRY_REMOTE_SUBSCRIBE_INTERVAL_VALUE);

        String regionName = REGION_PREFIX + regionId;
        HedwigClient client = regionClientsMap.get(regionName);
        for (int i = 0; i < batchSize; i++) {
            client.getSubscriber().asyncSubscribe(ByteString.copyFromUtf8("Topic" + i),
                                                  ByteString.copyFromUtf8("LocalSubscriber"), CreateOrAttach.CREATE_OR_ATTACH,
                                                  new TestCallback(queue), null);
            assertTrue(queue.take());
            client.getSubscriber().startDelivery(ByteString.copyFromUtf8("Topic" + i),
                    ByteString.copyFromUtf8("LocalSubscriber"), new TestMessageHandler(consumeQueue));
        }

        // Now start publishing messages for the subscribed topics in one of the
        // regions and verify that it gets delivered and consumed in all of the
        // other ones.       
View Full Code Here

        // Start delivery for the local subscribers in all regions
        for (HedwigClient client : regionClientsMap.values()) {
            for (int i = 0; i < batchSize; i++) {
                client.getSubscriber().startDelivery(ByteString.copyFromUtf8("Topic" + i),
                                                     ByteString.copyFromUtf8("LocalSubscriber"), new TestMessageHandler(consumeQueue));
            }
        }

        // Now start publishing messages for the subscribed topics in one of the
        // regions and verify that it gets delivered and consumed in all of the
View Full Code Here

        // Start delivery for local subscribers in all regions
        for (Map.Entry<String, HedwigClient> entry : regionClientsMap.entrySet()) {
            HedwigClient client = entry.getValue();
            for (int i = 0; i < batchSize; i++) {
                client.getSubscriber().startDelivery(ByteString.copyFromUtf8("Topic" + i),
                                                     ByteString.copyFromUtf8("LocalSubscriber"), new TestMessageHandler(consumeQueue));
            }
        }

        // Now start publishing messages for the subscribed topics in one of the
        // regions and verify that it gets delivered and consumed in all of the
View Full Code Here

        // Start delivery for local subscribers in all regions
        for (Map.Entry<String, HedwigClient> entry : regionClientsMap.entrySet()) {
            HedwigClient client = entry.getValue();
            for (int i = 0; i < batchSize; i++) {
                client.getSubscriber().startDelivery(ByteString.copyFromUtf8("Topic" + i),
                                                     ByteString.copyFromUtf8("LocalSubscriber"), new TestMessageHandler(consumeQueue));
            }
        }

        // start region again
        startRegion(regionId);
        // wait for retry
        Thread.sleep(3 * TEST_RETRY_REMOTE_SUBSCRIBE_INTERVAL_VALUE);

        String regionName = REGION_PREFIX + regionId;
        HedwigClient client = regionClientsMap.get(regionName);
        for (int i = 0; i < batchSize; i++) {
            client.getSubscriber().asyncSubscribe(ByteString.copyFromUtf8("Topic" + i),
                                                  ByteString.copyFromUtf8("LocalSubscriber"), CreateOrAttach.CREATE_OR_ATTACH,
                                                  new TestCallback(queue), null);
            assertTrue(queue.take());
            client.getSubscriber().startDelivery(ByteString.copyFromUtf8("Topic" + i),
                    ByteString.copyFromUtf8("LocalSubscriber"), new TestMessageHandler(consumeQueue));
        }

        // Now start publishing messages for the subscribed topics in one of the
        // regions and verify that it gets delivered and consumed in all of the
        // other ones.       
View Full Code Here

TOP

Related Classes of org.apache.hedwig.server.integration.TestHedwigHub.TestMessageHandler

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.