问题
The documentation for the Spring Cloud Stream Starter Apps for the RabbitMQ Source app lists several possible content types, each with a different resulting type for the output payload. However, it doesn't say how to choose which one you want to use. I'm deploying a Spring Cloud Data Flow connecting the Rabbit source to a Log sink, and all I get is the byte array. Even when I explicitly set the content type to "text/plain" in the Rabbit message's header, it shows up in the log sink as a byte array payload with headers: "contentType=application/octet-stream, originalContentType=text/plain".
I've got a vague idea that the answer is to set spring.cloud.stream.bindings.output.content-type to the content type I want the Rabbit source to output, but I don't know where to put this setting within the Spring Cloud Data Flow. I'm new at this, and extremely confused.
回答1:
You can pass Spring Cloud Stream properties in Spring Cloud Data Flow via deployment properties.
You can find more information on this here
来源:https://stackoverflow.com/questions/47850895/change-content-type-for-rabbitmq-spring-cloud-stream-starter-app