Package com.rabbitmq.client

Examples of com.rabbitmq.client.ShutdownSignalException


    return retryableChannelShutdownSignal();
  }

  protected ShutdownSignalException nonRetryableChannelShutdownSignal() {
    Method m = new AMQP.Channel.Close.Builder().replyCode(404).build();
    return new ShutdownSignalException(false, false, m, null);
  }
View Full Code Here


    return new ShutdownSignalException(false, false, m, null);
  }

  protected ShutdownSignalException retryableChannelShutdownSignal() {
    Method m = new AMQP.Channel.Close.Builder().replyCode(311).build();
    return new ShutdownSignalException(false, false, m, null);
  }
View Full Code Here

    return retryableConnectionShutdownSignal();
  }

  protected ShutdownSignalException retryableConnectionShutdownSignal() {
    Method m = new AMQP.Connection.Close.Builder().replyCode(320).build();
    return new ShutdownSignalException(true, false, m, null);
  }
View Full Code Here

    return new ShutdownSignalException(true, false, m, null);
  }

  protected ShutdownSignalException nonRetryableConnectionShutdownSignal() {
    Method m = new AMQP.Connection.Close.Builder().replyCode(530).build();
    return new ShutdownSignalException(true, false, m, null);
  }
View Full Code Here

        .withRecoveryPolicy(RecoveryPolicies.recoverAlways())
        .withChannelListeners(new DefaultChannelListener() {
          @Override
          public void onRecovery(Channel channel) {
            if (!shutdownCalled.get() && channel == mockChannel(2).proxy) {
              ShutdownSignalException e = nonRetryableChannelShutdownSignal();
              shutdownCalled.set(true);
              callShutdownListener(mockChannel(2).channelHandler, e);
              throw e;
            }
          }
View Full Code Here

      }, config.getChannelRecoveryPolicy(), recoveryStats, config.getRecoverableExceptions(), true, false);
      notifyRecovery();
      recoverConsumers(!viaConnectionRecovery);
      recoverySucceeded();
    } catch (Exception e) {
      ShutdownSignalException sse = Exceptions.extractCause(e, ShutdownSignalException.class);
      if (sse != null) {
        if (Exceptions.isConnectionClosure(sse))
          throw e;
      } else if (recoveryStats.isPolicyExceeded())
        recoveryFailed(e);
View Full Code Here

          consumerDeclaration.invoke(delegate);
          notifyAfterConsumerRecovery(consumer);
        } catch (Exception e) {
          log.error("Failed to recover consumer-{} via {}", entry.getKey(), this, e);
          notifyConsumerRecoveryFailure(consumer, e);
          ShutdownSignalException sse = Exceptions.extractCause(e, ShutdownSignalException.class);
          if (sse != null) {
            if (!Exceptions.isConnectionClosure(sse))
              it.remove();
            throw e;
          }
View Full Code Here

    return null;
  }

  public static boolean isCausedByConnectionClosure(Exception e) {
    ShutdownSignalException sse = Exceptions.extractCause(e, ShutdownSignalException.class);
    return sse != null && Exceptions.isConnectionClosure(sse);
  }
View Full Code Here

    while (true) {
      try {
        return callable.call();
      } catch (Exception e) {
        ShutdownSignalException sse = extractCause(e, ShutdownSignalException.class);
        if (sse == null && logFailures && recurringPolicy != null
            && recurringPolicy.allowsAttempts())
          log.error("Invocation of {} failed.", callable, e);

        if (sse != null && (recovery || !recoverable))
View Full Code Here

            channel = null;
        }
    }

    public void checkShutdownSignal(int expectedCode, IOException ioe) {
        ShutdownSignalException sse = (ShutdownSignalException) ioe.getCause();
        checkShutdownSignal(expectedCode, sse);
    }
View Full Code Here

TOP

Related Classes of com.rabbitmq.client.ShutdownSignalException

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.