编程知识 cdmana.com

Set the receivemessage parameter to message in Java notes spring rabbitmq

The following code :

public void receiveMessage(Message message){
	......
    ......
}

Which corresponds to Message This package :

import org.springframework.amqp.core.Message;

stay listner You can set it in this way :

    MessageListenerAdapter listenerAdapter(Receiver receiver){

        MessageListenerAdapter receiveMessage = new MessageListenerAdapter(receiver, "receiveMessage");
        receiveMessage.setMessageConverter(null);
        return receiveMessage;
    }

The key will be the code MessageConverter Set to null, that will do .

 

版权声明
本文为[IT1995]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201224152601525f.html

Scroll to Top