I have an application with multiple suppliers. So, I'm trying to configure fixed-delay
for the specific supplier in Spring Cloud Stream. Example:
application.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
code snippet
@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";
};
}
}
But according to spring's documentation https://docs.spring.io/spring-cloud-stream/docs/3.1.2/reference/html/spring-cloud-stream.html#_polling_configuration_properties, It seems to only be able to configure a org.springframework.cloud.stream.config.DefaultPollerProperties
bean for whole suppliers in an application. Is this correct?