title: RabbitTemplate.convertandsend() vs RabbitTemplate.sendandreceive()
body: <p>I am new to SpringBased RabbitMQ. I have started to write sample programs using RabbitTemplate and I have doubts,</p>
  
  <h2>Doubt 1:</h2>
  
  <p>understanding the exact use of 
  1.convertandsend() and 
  2.sendandreceive()</p>
  
  <h2>Doubt 2:</h2>
  
  <p>Based on the signatures,I got to know that sendandreceive() accepts "Message" as input and convertandsend() accepts "java object" as input.</p>
  
  <p>Considering the fact that everything is a Java Object, even "Message" would be a java object. That means Can i pass "Message" as parameter to the convertandsend()??</p>
  
  <h2>Doubt 3:</h2>
  
  <p>I tried to pass "Message" to convertandsend() as below,</p>
  
  <pre><code>Sender Program:
  ---------------
  
  
      String str = "Hello";
         Message msg = new Message(str.getBytes(),new MessageProperties());
         template.convertAndSend("MyExchange","MyKey",msg, new MessagePostProcessor()
  {
        @Override
  public Message postProcessMessage(Message message) throws AmqpException{
      message.getMessageProperties().setReplyToAddress(new Address("MyExchange/TestQueue"));
  return message;
            }
  });
  </code></pre>
  
  <h2>Receiver Program:</h2>
  
  <p><code>Message msg = (Message)template.receiveAndConvert("MyQueue");</code></p>
  
  <p>If I try to receive the "Message" in my Receiver code, I get "ClassCastException" </p>