Package org.springframework.amqp.core

Examples of org.springframework.amqp.core.MessagePostProcessor


  public void setDefaultReplyTo(String defaultReplyTo) {
    this.defaultReplyTo = defaultReplyTo;
  }
 
  public void send(TradeRequest tradeRequest) {
    getRabbitTemplate().convertAndSend(tradeRequest, new MessagePostProcessor() {
      public Message postProcessMessage(Message message) throws AmqpException {
        message.getMessageProperties().setReplyTo(defaultReplyTo);
        try {
          message.getMessageProperties().setCorrelationId(UUID.randomUUID().toString().getBytes("UTF-8"));
        }
View Full Code Here


  public void setDefaultReplyTo(String defaultReplyTo) {
    this.defaultReplyTo = defaultReplyTo;
  }
 
  public void send(TradeRequest tradeRequest) {
    getRabbitTemplate().convertAndSend(tradeRequest, new MessagePostProcessor() {
      public Message postProcessMessage(Message message) throws AmqpException {
        message.getMessageProperties().setReplyTo(new Address(defaultReplyTo));
        try {
          message.getMessageProperties().setCorrelationId(UUID.randomUUID().toString().getBytes("UTF-8"));
        }
View Full Code Here

      WorkMessage workMessage = new WorkMessage();
      workMessage.setCorrelationId(corrId);
      workMessage.setStart(i);
      workMessage.setNrOfElements(nrOfElements);
     
      rabbitTemplate.convertAndSend(workMessage, new MessagePostProcessor() {       
        public Message postProcessMessage(Message message) throws AmqpException {
          message.getMessageProperties().setReplyToAddress(new Address("direct://piExchange/" + QueueNames.RESULT_QUEUE_NAME));
          return message;
        }
      });
View Full Code Here

    assertEquals(null, result);
  }

  @Test
  public void testSendAndReceiveWithPostProcessor() throws Exception {
    template.convertAndSend(ROUTE, (Object)"message", new MessagePostProcessor() {
      @Override
      public Message postProcessMessage(Message message) throws AmqpException {
        message.getMessageProperties().setContentType("text/other");
        // message.getMessageProperties().setUserId("foo");
        return message;
View Full Code Here

        template.send(message.getMessageProperties().getReplyTo(), message);
        return (String) template.getMessageConverter().fromMessage(message);
      }

    });
    String result = (String) template.convertSendAndReceive((Object) "message", new MessagePostProcessor() {
      @Override
      public Message postProcessMessage(Message message) throws AmqpException {
        try {
          byte[] newBody = new String(message.getBody(), "UTF-8").toUpperCase().getBytes("UTF-8");
          return new Message(newBody, message.getMessageProperties());
View Full Code Here

        template.send(message.getMessageProperties().getReplyTo(), message);
        return (String) template.getMessageConverter().fromMessage(message);
      }

    });
    String result = (String) template.convertSendAndReceive(ROUTE, (Object) "message", new MessagePostProcessor() {
      @Override
      public Message postProcessMessage(Message message) throws AmqpException {
        try {
          byte[] newBody = new String(message.getBody(), "UTF-8").toUpperCase().getBytes("UTF-8");
          return new Message(newBody, message.getMessageProperties());
View Full Code Here

        template.send(message.getMessageProperties().getReplyTo(), message);
        return (String) template.getMessageConverter().fromMessage(message);
      }

    });
    String result = (String) template.convertSendAndReceive("", ROUTE, "message", new MessagePostProcessor() {

      @Override
      public Message postProcessMessage(Message message) throws AmqpException {
        try {
          byte[] newBody = new String(message.getBody(), "UTF-8").toUpperCase().getBytes("UTF-8");
View Full Code Here

TOP

Related Classes of org.springframework.amqp.core.MessagePostProcessor

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.