【RabbitMQ】反序列化失败 com.fasterxml.jackson.databind.exc.MismatchedInputException

记一次RabbitMQ,使用Jackson反序列化的报错;

报错:

Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `[B` out of START_OBJECT token
 at [Source: (String)"{"id":1,"userName":"jack","name":"lili"}"; line: 1, column: 1]

先上代码:
RabbitMQ的配置类就不上了,基本配置

生产者:

【RabbitMQ】反序列化失败 com.fasterxml.jackson.databind.exc.MismatchedInputException

消费者:

【RabbitMQ】反序列化失败 com.fasterxml.jackson.databind.exc.MismatchedInputException

分析

还是没找到原因,主要应该是反序列化失败,我修改了监听端的参数,接收Message对象,手动getBody,就可以接收到数据;

【RabbitMQ】反序列化失败 com.fasterxml.jackson.databind.exc.MismatchedInputException

有大佬知道的,请指正,感谢!

上一篇:Java后端传Long类型给前端导致的精度丢失


下一篇:SpringBoot JPA懒加载异常 - com.fasterxml.jackson.databind.JsonMappingException: could not initialize pr