Package org.apache.hedwig.exceptions.PubSubException

Examples of org.apache.hedwig.exceptions.PubSubException.ClientNotSubscribedException


            logger.debug("Calling consume for topic: " + topic.toStringUtf8() + ", subscriberId: "
                         + subscriberId.toStringUtf8() + ", messageSeqId: " + messageSeqId);
        TopicSubscriber topicSubscriber = new TopicSubscriber(topic, subscriberId);
        // Check that this topic subscription on the client side exists.
        if (!topicSubscriber2Channel.containsKey(topicSubscriber)) {
            throw new ClientNotSubscribedException(
                "Cannot send consume message since client is not subscribed to topic: " + topic.toStringUtf8()
                + ", subscriberId: " + subscriberId.toStringUtf8());
        }
        PubSubData pubSubData = new PubSubData(topic, null, subscriberId, OperationType.CONSUME, null, null, null);
        // Send the consume message to the server using the same subscribe
View Full Code Here


        // Channel created for the TopicSubscriber once the server has sent
        // an ack response to the initial subscribe request.
        if (!topicSubscriber2Channel.containsKey(topicSubscriber)) {
            logger.error("Client is not yet subscribed to topic: " + topic.toStringUtf8() + ", subscriberId: "
                         + subscriberId.toStringUtf8());
            throw new ClientNotSubscribedException("Client is not yet subscribed to topic: " + topic.toStringUtf8()
                                                   + ", subscriberId: " + subscriberId.toStringUtf8());
        }

        // Register the MessageHandler with the subscribe Channel's
        // Response Handler.
View Full Code Here

        // Channel created for the TopicSubscriber once the server has sent
        // an ack response to the initial subscribe request.
        if (!topicSubscriber2Channel.containsKey(topicSubscriber)) {
            logger.error("Client is not yet subscribed to topic: " + topic.toStringUtf8() + ", subscriberId: "
                         + subscriberId.toStringUtf8());
            throw new ClientNotSubscribedException("Client is not yet subscribed to topic: " + topic.toStringUtf8()
                                                   + ", subscriberId: " + subscriberId.toStringUtf8());
        }

        // Unregister the MessageHandler for the subscribe Channel's
        // Response Handler.
View Full Code Here

            pubSubData.callback.operationFinished(pubSubData.context, null);
            break;
        case CLIENT_NOT_SUBSCRIBED:
            // For Unsubscribe requests, the server says that the client was
            // never subscribed to the topic.
            pubSubData.callback.operationFailed(pubSubData.context, new ClientNotSubscribedException(
                                                    "Client was never subscribed to topic: " + pubSubData.topic.toStringUtf8() + ", subscriberId: "
                                                    + pubSubData.subscriberId.toStringUtf8()));
            break;
        case SERVICE_DOWN:
            // Response was service down failure so just invoke the callback's
View Full Code Here

            logger.debug("Calling consume for topic: " + topic.toStringUtf8() + ", subscriberId: "
                         + subscriberId.toStringUtf8() + ", messageSeqId: " + messageSeqId);
        TopicSubscriber topicSubscriber = new TopicSubscriber(topic, subscriberId);
        // Check that this topic subscription on the client side exists.
        if (!topicSubscriber2Channel.containsKey(topicSubscriber)) {
            throw new ClientNotSubscribedException(
                "Cannot send consume message since client is not subscribed to topic: " + topic.toStringUtf8()
                + ", subscriberId: " + subscriberId.toStringUtf8());
        }
        PubSubData pubSubData = new PubSubData(topic, null, subscriberId, OperationType.CONSUME, null, null, null);
        // Send the consume message to the server using the same subscribe
View Full Code Here

        // Channel created for the TopicSubscriber once the server has sent
        // an ack response to the initial subscribe request.
        if (!topicSubscriber2Channel.containsKey(topicSubscriber)) {
            logger.error("Client is not yet subscribed to topic: " + topic.toStringUtf8() + ", subscriberId: "
                         + subscriberId.toStringUtf8());
            throw new ClientNotSubscribedException("Client is not yet subscribed to topic: " + topic.toStringUtf8()
                                                   + ", subscriberId: " + subscriberId.toStringUtf8());
        }

        // Register the MessageHandler with the subscribe Channel's
        // Response Handler.
View Full Code Here

        // Channel created for the TopicSubscriber once the server has sent
        // an ack response to the initial subscribe request.
        if (!topicSubscriber2Channel.containsKey(topicSubscriber)) {
            logger.error("Client is not yet subscribed to topic: " + topic.toStringUtf8() + ", subscriberId: "
                         + subscriberId.toStringUtf8());
            throw new ClientNotSubscribedException("Client is not yet subscribed to topic: " + topic.toStringUtf8()
                                                   + ", subscriberId: " + subscriberId.toStringUtf8());
        }

        // Unregister the MessageHandler for the subscribe Channel's
        // Response Handler.
View Full Code Here

        SubscribeResponseHandler subscribeResponseHandler =
            channelManager.getSubscribeResponseHandler(topicSubscriber);
        // Check that this topic subscription on the client side exists.
        if (null == subscribeResponseHandler ||
            !subscribeResponseHandler.hasSubscription(topicSubscriber)) {
            throw new ClientNotSubscribedException(
                "Cannot send consume message since client is not subscribed to topic: "
                + topic.toStringUtf8() + ", subscriberId: " + subscriberId.toStringUtf8());
        }
        // Send the consume message to the server using the same subscribe
        // channel that the topic subscription uses.
View Full Code Here

            pubSubData.getCallback().operationFinished(pubSubData.context, null);
            break;
        case CLIENT_NOT_SUBSCRIBED:
            // For closesubscription requests, the server says that the client was
            // never subscribed to the topic.
            pubSubData.getCallback().operationFailed(pubSubData.context, new ClientNotSubscribedException(
                                                    "Client was never subscribed to topic: " +
                                                        pubSubData.topic.toStringUtf8() + ", subscriberId: " +
                                                        pubSubData.subscriberId.toStringUtf8()));
            break;
        case SERVICE_DOWN:
View Full Code Here

            pubSubData.getCallback().operationFinished(pubSubData.context, null);
            break;
        case CLIENT_NOT_SUBSCRIBED:
            // For Unsubscribe requests, the server says that the client was
            // never subscribed to the topic.
            pubSubData.getCallback().operationFailed(pubSubData.context, new ClientNotSubscribedException(
                                                    "Client was never subscribed to topic: " +
                                                        pubSubData.topic.toStringUtf8() + ", subscriberId: " +
                                                        pubSubData.subscriberId.toStringUtf8()));
            break;
        case SERVICE_DOWN:
View Full Code Here

TOP

Related Classes of org.apache.hedwig.exceptions.PubSubException.ClientNotSubscribedException

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.