title: How to consume an XML message from RabbitMQ in Spring Boot
body: <p>My requirement is such that, i will be getting an application/xml message from rabbit mq, which has to be consumed by SpringBoot. I am able to get it as a string, but when I create an entity and try to get the xml as a java object, it throws the following error:</p>
  
  <pre><code>org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener method could not be invoked with the incoming message
  </code></pre>
  
  <p>and followed by</p>
  
  <pre><code>Caused by: org.springframework.messaging.converter.MessageConversionException: Cannot convert from [[B] to [com.boot.RabbitListener.Model.XmlEntity] for GenericMessage [payload=byte[4], headers={amqp_receivedDeliveryMode=NON_PERSISTENT, amqp_receivedRoutingKey=jsa.queue1, amqp_deliveryTag=1, amqp_consumerQueue=jsa.queue1, amqp_redelivered=false, id=0afca290-7ee2-36f5-4297-afeacbc451da, amqp_consumerTag=amq.ctag-HZO32UVNiMf9hWo_pAr9Bw, contentType=application/xml, timestamp=1542820548981}]
  </code></pre>
  
  <p>I am new to SpringBoot and i read some articles in marshler, but i am not sure on how to use it. </p>