在 spring-cloud-stream kafka binder 中接受二进制 json 消息的属性是什么 [英] what is the property to accept binary json message in spring-cloud-stream kafka binder

查看:37
本文介绍了在 spring-cloud-stream kafka binder 中接受二进制 json 消息的属性是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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/textspring.cloud.stream.bindings. 时.consumer.‌ headerMode:raw 它有效.

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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆