title: Spring AMQP @RabbitListener convert to origin object
body: <p>I try to send a message based on a flatten MAP using Spring Boot and AMQP. The message should then be received using @RabbitListener and transfer it back to a MAP. </p>
  
  <p>First I have nested json String and flat it and send it using the following code:</p>
  
  <pre><code>// Flatten the JSON String returned into a map 
          Map&lt;String,Object&gt; jsonMap = JsonFlattener.flattenAsMap(result);
  
  rabbitTemplate.convertAndSend(ApplicationProperties.rmqExchange, ApplicationProperties.rmqTopic, jsonMap, new MessagePostProcessor() {
              @Override
              public Message postProcessMessage(Message message) throws AmqpException {
                  message.getMessageProperties().setHeader("amqp_Key1", "wert1");
                  message.getMessageProperties().setHeader("amqp_Key2", "Wert2");
                  message.getMessageProperties().setDeliveryMode(MessageDeliveryMode.PERSISTENT);
                  return message;
              }
          });
  </code></pre>
  
  <p>So far so good. </p>
  
  <p>On the receiving site I try to use a Listener and convert the message payload back to the Map as it was send before.</p>
  
  <p>The problem ist that I have no idea how to do it. 
  I receive the message with the following code:</p>
  
  <pre><code>      @RabbitListener(queues = "temparea")
      public void receiveMessage(Message message) {
  
  
        log.info("Receiving data from RabbitMQ:");
        log.info("Message is of type: " + message.getClass().getName());
        log.info("Message: " + message.toString());   
      }
  </code></pre>
  
  <p>As I mentioned before I have no idea how I can convert the message to my old MAP. The __ TypeId __ of the Message is: com.github.wnameless.json.flattener.JsonifyLinkedHashMap</p>
  
  <p>I would be more than glad if somebody could assist me how I get this message back to an Java Map.</p>
  
  <p>BR</p>
  
  <hr>
  
  <p>Update after answer from Artem Bilan:</p>
  
  <p>I added the following code to my configuration file:</p>
  
  <pre><code>    @Bean
  public SimpleRabbitListenerContainerFactory myRabbitListenerContainerFactory() {
    SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
    factory.setMessageConverter(new Jackson2JsonMessageConverter());
    factory.setConnectionFactory(connectionFactory());
    factory.setMaxConcurrentConsumers(5);
    return factory;
  }
  </code></pre>
  
  <p>But still I have no idea how to get the Map out of my message. 
  The new code block does not change anything.</p>