【问题标题】:Record in Kafka 0.10 coming with contentType even after using app.spring.cloud.stream.bindings.output.producer.headerMode=raw即使在使用 app.spring.cloud.stream.bindings.output.producer.headerMode=raw 之后,也会在 Kafka 0.10 中记录 contentType
【发布时间】: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


    【解决方案1】:

    已解决。

    更改了以下属性:

    app.http.spring.cloud.stream.bindings.output.producer.headerMode=raw
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-09
      • 1970-01-01
      • 1970-01-01
      • 2019-09-09
      • 2013-06-18
      • 1970-01-01
      • 1970-01-01
      • 2012-08-24
      相关资源
      最近更新 更多