在 spring-cloud-stream kafka binder 中接受二进制 json 消息的属性是什么 [英] what is the property to accept binary json message in spring-cloud-stream kafka binder
问题描述
我正在使用 spring-cloud-stream kafka 绑定器来使用来自 kafka 主题的消息.源系统以 ascii 格式发送 json 消息.当我的消费者收听它抛出的主题时
I am using spring-cloud-stream kafka binder to consume messages from a kafka topic. The source system is sending the json message in ascii. When My consumer listens to the topic it throws
o.s.c.s.b.k.KafkaMessageChannelBinder : Could not convert message: 7B22736..
我可以在 .yml 文件中设置任何属性来反序列化它吗?或者有没有我可以研究的例子?
Is there any property that I can set in my .yml file to deserialize it? or is there an example that I can look into?
推荐答案
当我添加 content-type:plain/text
和 spring.cloud.stream.bindings.
它有效.
When I added content-type:plain/text
and spring.cloud.stream.bindings.<subscriptionChannel>.consumer.headerMode:raw
it worked.
谢谢!
这篇关于在 spring-cloud-stream kafka binder 中接受二进制 json 消息的属性是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!