Package org.apache.hedwig.client.conf

Examples of org.apache.hedwig.client.conf.ClientConfiguration


    // The following 4 tests are to make sure that the subscriberId validation
    // also works when it is a hub subscriber and we're expecting the
    // subscriberId to be in the "hub" specific format.
    @Test
    public void testSyncHubSubscribeWithInvalidSubscriberId() throws Exception {
        Client hubClient = new HedwigHubClient(new ClientConfiguration());
        Subscriber hubSubscriber = hubClient.getSubscriber();
        boolean subscribeSuccess = false;
        try {
            hubSubscriber.subscribe(getTopic(0), localSubscriberId, CreateOrAttach.CREATE_OR_ATTACH);
        } catch (InvalidSubscriberIdException e) {
View Full Code Here


        hubClient.close();
    }

    @Test
    public void testAsyncHubSubscribeWithInvalidSubscriberId() throws Exception {
        Client hubClient = new HedwigHubClient(new ClientConfiguration());
        Subscriber hubSubscriber = hubClient.getSubscriber();
        hubSubscriber.asyncSubscribe(getTopic(0), localSubscriberId, CreateOrAttach.CREATE_OR_ATTACH, new TestCallback(
                                         queue), null);
        assertFalse(queue.take());
        hubClient.close();
View Full Code Here

        hubClient.close();
    }

    @Test
    public void testSyncHubUnsubscribeWithInvalidSubscriberId() throws Exception {
        Client hubClient = new HedwigHubClient(new ClientConfiguration());
        Subscriber hubSubscriber = hubClient.getSubscriber();
        boolean unsubscribeSuccess = false;
        try {
            hubSubscriber.unsubscribe(getTopic(0), localSubscriberId);
        } catch (InvalidSubscriberIdException e) {
View Full Code Here

        hubClient.close();
    }

    @Test
    public void testAsyncHubUnsubscribeWithInvalidSubscriberId() throws Exception {
        Client hubClient = new HedwigHubClient(new ClientConfiguration());
        Subscriber hubSubscriber = hubClient.getSubscriber();
        hubSubscriber.asyncUnsubscribe(getTopic(0), localSubscriberId, new TestCallback(queue), null);
        assertFalse(queue.take());
        hubClient.close();
    }
View Full Code Here

     * @param hub
     *            The hub in another region to connect to.
     */
    HedwigHubClient create(final HedwigSocketAddress hub) {
        // Create a hub specific version of the client to use
        return new HedwigHubClient(new ClientConfiguration() {
            @Override
            protected HedwigSocketAddress getDefaultServerHedwigSocketAddress() {
                return hub;
            }

View Full Code Here

    @Override
    @Before
    public void setUp() throws Exception {
        super.setUp();
        client = new HedwigClient(new ClientConfiguration());
        publisher = client.getPublisher();
        subscriber = client.getSubscriber();
    }
View Full Code Here

    }
   
    @Override
    public void setUp() throws Exception {
        super.setUp();
        client = new HedwigClient(new ClientConfiguration());

        publisher = client.getPublisher();
        subscriber = client.getSubscriber();
    }
View Full Code Here

        return null;
    }

    public static void main(String[] args) throws Exception {
        ClientConfiguration cfg = new ClientConfiguration();
        if (args.length > 0) {
            String confFile = args[0];
            try {
                cfg.loadConf(new File(confFile).toURI().toURL());
            } catch (ConfigurationException e) {
                throw new RuntimeException(e);
            }
        }
View Full Code Here

        return server;

    }

    public void runPublishRequest(final int port) throws Exception {
        Publisher publisher = new HedwigClient(new ClientConfiguration() {
            @Override
            public InetSocketAddress getDefaultServerHost() {
                return new InetSocketAddress("localhost", port);
            }
        }).getPublisher();
View Full Code Here

    // The following 4 tests are to make sure that the subscriberId validation
    // also works when it is a hub subscriber and we're expecting the
    // subscriberId to be in the "hub" specific format.
    @Test
    public void testSyncHubSubscribeWithInvalidSubscriberId() throws Exception {
        Client hubClient = new HedwigHubClient(new ClientConfiguration());
        Subscriber hubSubscriber = hubClient.getSubscriber();
        boolean subscribeSuccess = false;
        try {
            hubSubscriber.subscribe(getTopic(0), localSubscriberId, CreateOrAttach.CREATE_OR_ATTACH);
        } catch (InvalidSubscriberIdException e) {
View Full Code Here

TOP

Related Classes of org.apache.hedwig.client.conf.ClientConfiguration

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.