Package org.springframework.amqp

Examples of org.springframework.amqp.AmqpException


        message.getMessageProperties().setReplyTo(defaultReplyTo);
        try {
          message.getMessageProperties().setCorrelationId(UUID.randomUUID().toString().getBytes("UTF-8"));
        }
        catch (UnsupportedEncodingException e) {
          throw new AmqpException(e);
        }
        return message;
      }
    });
  }
View Full Code Here


   */
  private Address getReplyToAddress(Message request) throws AmqpException {
    Address replyTo = request.getMessageProperties().getReplyToAddress();
    if (replyTo == null) {
      if (this.exchange == null) {
        throw new AmqpException(
            "Cannot determine ReplyTo message property value: "
                + "Request message does not contain reply-to property, and no default Exchange was set.");
      }
      replyTo = new Address(null, this.exchange, this.routingKey);
    }
View Full Code Here

        message.getMessageProperties().setReplyTo(new Address(defaultReplyTo));
        try {
          message.getMessageProperties().setCorrelationId(UUID.randomUUID().toString().getBytes("UTF-8"));
        }
        catch (UnsupportedEncodingException e) {
          throw new AmqpException(e);
        }
        return message;
      }
    });
  }
View Full Code Here

  public void testConvertRabbitAccessException() {

    assertThat(RabbitExceptionTranslator.convertRabbitAccessException(new PossibleAuthenticationFailureException(new RuntimeException())),
        instanceOf(AmqpAuthenticationException.class));

    assertThat(RabbitExceptionTranslator.convertRabbitAccessException(new AmqpException("")),
        instanceOf(AmqpException.class));

    assertThat(RabbitExceptionTranslator.convertRabbitAccessException(new ShutdownSignalException(false, false, null, null)),
        instanceOf(AmqpConnectException.class));
View Full Code Here

        try {
          byte[] newBody = new String(message.getBody(), "UTF-8").toUpperCase().getBytes("UTF-8");
          return new Message(newBody, message.getMessageProperties());
        }
        catch (Exception e) {
          throw new AmqpException("unexpected failure in test", e);
        }
      }
    });
    assertEquals("MESSAGE", received.get(1000, TimeUnit.MILLISECONDS));
    assertEquals("MESSAGE", result);
View Full Code Here

        try {
          byte[] newBody = new String(message.getBody(), "UTF-8").toUpperCase().getBytes("UTF-8");
          return new Message(newBody, message.getMessageProperties());
        }
        catch (Exception e) {
          throw new AmqpException("unexpected failure in test", e);
        }
      }
    });
    assertEquals("MESSAGE", received.get(1000, TimeUnit.MILLISECONDS));
    assertEquals("MESSAGE", result);
View Full Code Here

        try {
          byte[] newBody = new String(message.getBody(), "UTF-8").toUpperCase().getBytes("UTF-8");
          return new Message(newBody, message.getMessageProperties());
        }
        catch (Exception e) {
          throw new AmqpException("unexpected failure in test", e);
        }
      }
    });
    assertEquals("MESSAGE", received.get(1000, TimeUnit.MILLISECONDS));
    assertEquals("MESSAGE", result);
View Full Code Here

   */
  protected Address getReplyToAddress(Message request) throws Exception {
    Address replyTo = request.getMessageProperties().getReplyToAddress();
    if (replyTo == null) {
      if (this.responseExchange == null) {
        throw new AmqpException(
            "Cannot determine ReplyTo message property value: " +
                "Request message does not contain reply-to property, " +
                "and no default response Exchange was set.");
      }
      replyTo = new Address(this.responseExchange, this.responseRoutingKey);
View Full Code Here

   */
  private Address getReplyToAddress(Message request) throws AmqpException {
    Address replyTo = request.getMessageProperties().getReplyToAddress();
    if (replyTo == null) {
      if (this.exchange == null) {
        throw new AmqpException(
            "Cannot determine ReplyTo message property value: "
                + "Request message does not contain reply-to property, and no default Exchange was set.");
      }
      replyTo = new Address(this.exchange, this.routingKey);
    }
View Full Code Here

          }
        }
        channel.txCommit();
      }
    } catch (IOException e) {
      throw new AmqpException("failed to commit RabbitMQ transaction", e);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.amqp.AmqpException

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.