【发布时间】:2019-01-21 13:02:14
【问题描述】:
我在 Spring Cloud 数据流中创建了一个简单的流,其中 http 作为源,kafka 作为接收器。
stream create --definition "http --port=<yyyy> --path-pattern=/test > :streamtest1" --name ingest_to_broker_from_http --deploy --properties app.spring.cloud.stream.bindings.output.producer.headerMode=raw
即使在使用 app.spring.cloud.stream.bindings.output.producer.headerMode=raw 之后, 我正在接收带有 contentType 应用程序字符串的 Kafka 消息。
cURL 命令:
curl -X POST -H "Content-Type: application/json" --data '{"name":"test6"}' http://<xxxx>:<yyyy>/test
卡夫卡消息:
contentType "text/plain"originalContentType "application/json;charset=UTF-8"{"name":"test6"}
- 我是否以正确的方式传递 headerMode 属性?
- 我应该怎么做才能只接收消息(不带标题) Kafka 主题?
【问题讨论】:
标签: apache-kafka spring-cloud-dataflow