MQ Cannot convert from [[B] to [] for GenericMessage
Posted sandyyeh
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MQ Cannot convert from [[B] to [] for GenericMessage相关的知识,希望对你有一定的参考价值。
MQ消费端转换报错:
主要错误信息:
Caused by: org.springframework.messaging.converter.MessageConversionException: Cannot convert from [[B] to [com.***.***.***.***] for GenericMessage
[payload=byte[12], headers=amqp_receivedDeliveryMode=NON_PERSISTENT, amqp_receivedRoutingKey=ENT_***_NOTICE, amqp_deliveryTag=4, amqp_consumerQueue=ENT_***_NOTICE,
amqp_redelivered=false, id=cf822382-2a6e-8030-add4-b59bfa561e34, amqp_consumerTag=amq.ctag-2BJwxJlkUYKxiAkxPc67kA, timestamp=1559721028305]
解决方法替换点mq默认的序列化器。
/** * @link org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration * 会自动识别 * @param objectMapper json序列化实现类 * @return mq 消息序列化工具 */ @Bean public MessageConverter jsonMessageConverter(ObjectMapper objectMapper) return new Jackson2JsonMessageConverter(objectMapper);
以上是关于MQ Cannot convert from [[B] to [] for GenericMessage的主要内容,如果未能解决你的问题,请参考以下文章
cannot convert from 'const char [3]' to 'char'
error C2664: 'strcpy' : cannot convert parameter 2 from 'LPCTSTR' to 'const char
OpenGL学习笔记-3:编译shader报错: cannot convert from 'const highp float' to 'FragUserData 4-com
C++求助[Error]cannot convert 'const wchar_t*' to 'LPCSTR aka const char*