Package org.springframework.amqp

Examples of org.springframework.amqp.AmqpRejectAndDontRequeueException


    container.setErrorHandler(new ErrorHandler() {

      @Override
      public void handleError(Throwable t) {
        errorHandled.countDown();
        throw new AmqpRejectAndDontRequeueException("foo", t);
      }
    });
    container.setMessageListener(new MessageListener() {

      @Override
View Full Code Here


    }
    catch (AmqpRejectAndDontRequeueException aradre) {
      assertSame(e, aradre.getCause());
    }
    e = new ListenerExecutionFailedException("foo", new MessageConversionException("bar",
        new AmqpRejectAndDontRequeueException("baz")));
    eh.handleError(e);
  }
View Full Code Here

    testRequeueOrNotDefaultYes(null, true);
  }

  @Test
  public void testDontRequeue() throws Exception {
    testRequeueOrNotDefaultYes(new AmqpRejectAndDontRequeueException("fail"), false);
  }
View Full Code Here

    testRequeueOrNotDefaultYes(new AmqpRejectAndDontRequeueException("fail"), false);
  }

  @Test
  public void testDontRequeueNested() throws Exception {
    Exception ex = new RuntimeException(new RuntimeException(new AmqpRejectAndDontRequeueException("fail")));
    testRequeueOrNotDefaultYes(ex, false);
  }
View Full Code Here

    testRequeueOrNotDefaultNo(null, false);
  }

  @Test
  public void testDontRequeueDefaultNot() throws Exception {
    testRequeueOrNotDefaultNo(new AmqpRejectAndDontRequeueException("fail"), false);
  }
View Full Code Here

    testRequeueOrNotDefaultNo(new AmqpRejectAndDontRequeueException("fail"), false);
  }

  @Test
  public void testDontRequeueNestedDefaultNot() throws Exception {
    Exception ex = new RuntimeException(new RuntimeException(new AmqpRejectAndDontRequeueException("fail")));
    testRequeueOrNotDefaultNo(ex, false);
  }
View Full Code Here

      PendingReply pendingReply = this.replyHolder.get(messageTag);
      if (pendingReply == null) {
        if (logger.isWarnEnabled()) {
          logger.warn("Reply received after timeout for " + messageTag);
        }
        throw new AmqpRejectAndDontRequeueException("Reply received after timeout");
      }
      else {
        // Restore the inbound correlation data
        String savedCorrelation = pendingReply.getSavedCorrelation();
        if (this.correlationKey == null) {
View Full Code Here

  @Override
  public void onMessage(Message message) {
    Address replyToAddress = message.getMessageProperties().getReplyToAddress();
    if (replyToAddress == null) {
      throw new AmqpRejectAndDontRequeueException("No replyToAddress in inbound AMQP Message");
    }

    Object invocationRaw = messageConverter.fromMessage(message);
    if (invocationRaw == null || !(invocationRaw instanceof RemoteInvocation)) {
      send(new RuntimeException("The message does not contain a RemoteInvocation payload"), replyToAddress);
View Full Code Here

  public void handleError(Throwable t) {
    if (logger.isWarnEnabled()) {
      logger.warn("Execution of Rabbit message listener failed.", t);
    }
    if (!this.causeChainContainsARADRE(t) && this.exceptionStrategy.isFatal(t)) {
      throw new AmqpRejectAndDontRequeueException("Error Handler converted exception to fatal", t);
    }
  }
View Full Code Here

      if (id != null && redelivered) {
        if (logger.isDebugEnabled()) {
          logger.debug("Canceling delivery of retried message that has no ID");
        }
        throw new ListenerExecutionFailedException("Cannot retry message without an ID",
            new AmqpRejectAndDontRequeueException(t), message);
      }
      else {
        throw t;
      }
    }
View Full Code Here

TOP

Related Classes of org.springframework.amqp.AmqpRejectAndDontRequeueException

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.