Package org.apache.hedwig.protocol.PubSubProtocol

Examples of org.apache.hedwig.protocol.PubSubProtocol.ResponseBody


                                // First write success and then tell the delivery manager,
                                // otherwise the first message might go out before the response
                                // to the subscribe
                                SubscribeResponse.Builder subRespBuilder = SubscribeResponse.newBuilder()
                                    .setPreferences(subData.getPreferences());
                                ResponseBody respBody = ResponseBody.newBuilder()
                                    .setSubscribeResponse(subRespBuilder).build();
                                channel.write(PubSubResponseUtils.getSuccessResponse(request.getTxnId(), respBody));
                                logger.info("Subscribe request (" + request.getTxnId() + ") for (topic:"
                                            + topic.toStringUtf8() + ", subscriber:" + subscriberId.toStringUtf8()
                                            + ") from channel " + channel.getRemoteAddress()
View Full Code Here


                                 failureException);
                    throw new ServiceDownException("Server ack response to publish request is not successful");
                }
            }

            ResponseBody respBody = pubSubCallback.getResponseBody();
            if (null == respBody) {
                return null;
            }
            return respBody.hasPublishResponse() ? respBody.getPublishResponse() : null;
        }
    }
View Full Code Here

            return;
        }

        // Process Subscription Events
        if (response.hasResponseBody()) {
            ResponseBody resp = response.getResponseBody();
            // A special subscription event indicates the state of a subscriber
            if (resp.hasSubscriptionEvent()) {
                if (null == subHandler) {
                    logger.error("Received subscription event from a non-subscription channel : {}",
                                 response);
                } else {
                    SubscriptionEventResponse eventResp = resp.getSubscriptionEvent();
                    logger.debug("Received subscription event {} for (topic:{}, subscriber:{}).",
                                 va(eventResp.getEvent(), response.getTopic(),
                                    response.getSubscriberId()));
                    subHandler.handleSubscriptionEvent(response.getTopic(),
                                                       response.getSubscriberId(),
View Full Code Here

        case SUCCESS:
            TopicSubscriber ts = new TopicSubscriber(pubSubData.topic,
                                                     pubSubData.subscriberId);
            SubscriptionPreferences preferences = null;
            if (response.hasResponseBody()) {
                ResponseBody respBody = response.getResponseBody();
                if (respBody.hasSubscribeResponse()) {
                    SubscribeResponse resp = respBody.getSubscribeResponse();
                    if (resp.hasPreferences()) {
                        preferences = resp.getPreferences();
                        if (logger.isDebugEnabled()) {
                            logger.debug("Receive subscription preferences for {} : {}",
                                         va(ts,
View Full Code Here

TOP

Related Classes of org.apache.hedwig.protocol.PubSubProtocol.ResponseBody

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.