更改 RabbitMQ Spring Cloud Stream Starter App 的内容类型 [英] Change content type for RabbitMQ Spring Cloud Stream Starter App

查看:28
本文介绍了更改 RabbitMQ Spring Cloud Stream Starter App 的内容类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Spring Cloud Stream Starter Apps 列出了几种可能的内容类型,每种类型的输出负载都有不同的结果类型.但是,它没有说明如何选择要使用的那个.我正在部署一个 Spring Cloud 数据流,将 Rabbit 源连接到一个日志接收器,我得到的只是字节数组.即使我在 Rabbit 消息的标头中将内容类型明确设置为text/plain",它也会在日志接收器中显示为带有标头的字节数组有效负载:contentType=application/octet-stream, originalContentType=text/plain".

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".

我有一个模糊的想法,答案是将 spring.cloud.stream.bindings.output.content-type 设置为我希望 Rabbit 源输出的内容类型,但我不知道该放在哪里Spring Cloud Data Flow 中的此设置.我是新手,非常困惑.

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.

推荐答案

您可以通过部署属性在 Spring Cloud Data Flow 中传递 Spring Cloud Stream 属性.

You can pass Spring Cloud Stream properties in Spring Cloud Data Flow via deployment properties.

您可以找到有关此 这里

这篇关于更改 RabbitMQ Spring Cloud Stream Starter App 的内容类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆