I have created a simple stream in spring cloud dataflow where I have http as source and kafka as sink.
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
Even after using app.spring.cloud.stream.bindings.output.producer.headerMode=raw, I am receiving Kafka messages with contentType application string.
cURL Command:
curl -X POST -H "Content-Type: application/json" --data '{"name":"test6"}' http://<xxxx>:<yyyy>/test
Kafka Message:
contentType "text/plain"originalContentType "application/json;charset=UTF-8"{"name":"test6"}
Resolved.
Changed the below property:
app.http.spring.cloud.stream.bindings.output.producer.headerMode=raw