出错说明
集成kafka为了获取支持多种方式处理日志,目前平台已支持直接入库的模式,现增加了Kafka的模式,后续会集成elk的模式。
在集成kafka的时候,发送消息成功,但接收消息时,获取到的对象内容为空。
排查过程
修改配置参数
spring:
##Kafka配置
cloud:
stream:
bindings:
log_input:
destination: mate-log
# producer:
# headerMode: none
# content-type: text/plain
log_output:
destination: mate-log
# consumer:
# headerMode: none
# content-type: application/json
# default-binder: kafka
kafka:
binder:
brokers: localhost:9092
zk-nodes: localhost:2181
auto-create-topics: true
调整过content-type和headerMode等参数,结果还是显示为空
样例如下: