Examples of ProtocolResultCodeException


Examples of com.cloudhopper.mq.broker.protocol.ProtocolResultCodeException

    public void onThrowable(Throwable t) {
        boolean retryable = true;
        if (t instanceof ProtocolResultCodeException) {
      // remote broker returned a specific error code (but did respond :-))
      // depending on the actual error, we should likely do something special
      ProtocolResultCodeException e = (ProtocolResultCodeException)t;
      if (e.getResultCode() == ProtocolConstants.RC_NO_QUEUE || e.getResultCode() == ProtocolConstants.RC_NO_CONSUMER) {
          logger.warn("[{}] RemoteBroker [{}] returned an error indicating the queue is either gone or no longer has a consumer", remoteQueue.getName(), remoteBrokerUrl);
          if (listener != null) { listener.notifyQueueOnRemoteBrokerIsNoLongerAvailable(remoteBrokerUrl, remoteQueue.getName()); }
      } else if (e.getResultCode() == ProtocolConstants.RC_GROUP_NAME_MISMATCH) {
          // this should really only happen if the remote system was restarted and no longer matches ours
          logger.warn("[{}] The group on RemoteBroker [{}] no longer matches ours", remoteQueue.getName(), remoteBrokerUrl);
          if (listener != null) { listener.notifyRemoteBrokerIsNoLongerAvailable(remoteBrokerUrl, e.getMessage()); }
      } else {
          // any other errors such as ITEM_TYPE_MISMATCH, etc..
          logger.warn("[{}] Result code [{}] from remote broker [{}] was not OK, safest action is to notifyQueueOnRemoteBrokerIsNoLongerAvailable", new Object[] { remoteQueue.getName(), e.getResultCode(), remoteBrokerUrl });
          if (listener != null) { listener.notifyQueueOnRemoteBrokerIsNoLongerAvailable(remoteBrokerUrl, remoteQueue.getName()); }
      }
        } else if (t instanceof ProtocolParsingException) {
      // remote broker return a bad protocol response (yet it was still an HTTP 200 error code)
      // this is the most difficult exception since the item *MAY* have actually
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.