Decode AMQP message as a Map using Spring
<p>I have to decode AMQP message using Spring. To handle it I now use:</p>

<pre><code>    // Configure queue. 
    RabbitAdmin admin = new RabbitAdmin(cf);
    Queue queue = new Queue(queueName);
    admin.declareQueue(queue);
    FanoutExchange exchange = new FanoutExchange(exchangeName);
    admin.declareExchange(exchange);
    admin.declareBinding(BindingBuilder.bind(queue).to(exchange));  

    // set up the listener and container
    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(cf);

    MessageListenerAdapter adapter = new MessageListenerAdapter(listener);
    container.setMessageListener(adapter);
    container.setQueueNames(queueName);
    container.start();
</code></pre>

<p>And my Listener is </p>

<pre><code>public class DataListener {

    public void handleMessage(Object incomingMessage) {
        LOGGER.error("AMQP: got message.{}", incomingMessage);
    }   

}
</code></pre>

<p>The message is sent using convertAndSend method of AmqpTemplate. No configuration was given to AmqpTemplate, everything is by default.</p>

<p>How I can possibly receive my incomingMessage as a HashMap of fields? I do not want to strongly couple it to particular object type. </p>