我有多个供应商的应用程序。因此,我正在尝试为fixed-delay
Spring Cloud Stream 中的特定供应商进行配置。例子:
应用程序.yaml
spring:
cloud:
function:
definition: produce;produce2
stream:
poller:
produce:
fixedDelay: 10000L
produce2:
fixedDelay: 5000L
bindings:
produce-out-0:
destination: string-output
produce2-out-0:
destination: string-output-2
代码片段
@Configuration
public class ProducerConfiguration {
private static final Logger LOGGER = LoggerFactory.getLogger(ProducerConfiguration.class);
@Bean
public Supplier<Object> produce() {
return () -> {
LOGGER.info("message");
return "message";
};
}
@Bean
public Supplier<Object> produce2() {
return () -> {
LOGGER.info("message-2");
return "message-2";
};
}
}
但是根据spring的文档https://docs.spring.io/spring-cloud-stream/docs/3.1.2/reference/html/spring-cloud-stream.html#_polling_configuration_properties,好像只能配置一个org.springframework.cloud.stream.config.DefaultPollerProperties
应用程序中的整个供应商的 bean。这个对吗?