Spring Cloud Stream应用程序中的timestampExtractorBeanName设置不会覆盖默认值
对于使用Kafka Streams Binder的Spring Cloud Stream应用程序,我具有以下属性:
I have the following properties for my Spring Cloud Stream application that uses Kafka Streams Binder:
spring.cloud.stream.bindings:
windowStream-in-0:
destination: input
windowStream-out-0:
destination: window1
hint1Stream-in-0:
destination: window1
hint1Stream-out-0:
destination: hints
realityStream-in-0:
destination: input
realityStream-in-1:
destination: window1
consumer:
timestampExtractorBeanName: anotherTimestampExtractor
realityStream-out-0:
destination: hints
countStream-in-0:
destination: hints
spring.cloud.stream.kafka.streams:
default:
consumer:
timestampExtractorBeanName: timestampExtractor
binder:
functions:
windowStream:
applicationId: mock-stream-window1
hint1Stream:
applicationId: mock-stream-hints
realityStream:
applicationId: mock-stream-reality
countStream:
applicationId: mock-stream-count
stateStoreRetry:
maxAttempts: 3
backOffInterval: 1000
configuration:
schema.registry.url: mock://mock-stream-registry
default.key.serde: org.apache.kafka.common.serialization.Serdes$StringSerde
default.value.serde: io.confluent.kafka.streams.serdes.avro.SpecificAvroSerde
commit.interval.ms: 100
我想做的是对除称为"realityStream"的流之外的所有流使用"timestampExtractor".
What I am trying to do is to use the "timestampExtractor" for all streams except for one, called "realityStream".
为此,我将 spring.cloud.stream.kafka.streams.default.consumer.timestampExtractorBeanName
设置为 timestampExtractor
,然后尝试将其替代"为通过设置 spring.cloud.stream.bindings.realityStream-in-1.consumer.timestampExtractorBeanName
For that I set the spring.cloud.stream.kafka.streams.default.consumer.timestampExtractorBeanName
to timestampExtractor
and then try to "override" it for the "realityStream" by setting spring.cloud.stream.bindings.realityStream-in-1.consumer.timestampExtractorBeanName
不幸的是,似乎我的覆盖无效,因为只有"timestampExtractor"被调用,正如我在调试器(以及测试结果)中所看到的那样.
Unfortunately, it seems that my override doesn't work, since only "timestampExtractor" is getting called only, as I can see in the debugger (and in my test results).
我是错误地应用了配置,还是有错误的期望?
Am I applying the configuration wrong, or have wrong expectation?
这是我的单个Spring Cloud Streams应用程序中的流的图片:
Here's a picture of the streams in my single Spring Cloud Streams application:
(橙色圆圈是我要应用非默认时间戳提取器的地方)
(orange circle is the place where I want to apply non-default timestamp extractor)
覆盖位置错误;它必须位于 .... kafka.streams.bindings.realityStream-in-1 ....
属性下.
The override is in the wrong place; it needs to be under the ....kafka.streams.bindings.realityStream-in-1....
property.
这是kafka特有的属性;您可以在通用绑定属性中找到它(所有活页夹通用).
It's a kafka-specific property; you have it in the generic bindings properties (common to all binders).