Spring boot 在Spring Cloud Stream中设置带有句点的主题的内容类型

Spring boot 在Spring Cloud Stream中设置带有句点的主题的内容类型,spring-boot,spring-cloud-stream,spring-kafka,Spring Boot,Spring Cloud Stream,Spring Kafka,我有一个SpringCloudStream应用程序Finchley.SR1,它的主题名称中有句点。在application.properties中,我想设置不同主题的内容类型,但由于主题中有句点,因此无法按预期工作 我的application.properties如下所示: spring.cloud.stream.bindings.topic1.with.periods.content-type=application/topic1 spring.cloud.stream.bindings.to

我有一个SpringCloudStream应用程序Finchley.SR1,它的主题名称中有句点。在application.properties中,我想设置不同主题的内容类型,但由于主题中有句点,因此无法按预期工作

我的application.properties如下所示:

spring.cloud.stream.bindings.topic1.with.periods.content-type=application/topic1
spring.cloud.stream.bindings.topic2.with.periods.content-type=application/topic2
spring.cloud.stream.default.content-type=application/other

我的所有邮件都将内容类型设置为application/other,而不是设置了正确的内容类型头。我也尝试过使用contentType而不是content type,但这也不起作用。

为什么需要句点

您可以使用简单的名称命名绑定,并将目标设置为虚线名称

@Output("foo")
MessageChannel foo();
然后


不知何故,我在文档中遗漏了这一点。谢谢
spring.cloud.stream.bindings.foo.destination=topic1.with.periods
spring.cloud.stream.bindings.foo.content-type=application/topic1