问题
I am building an integration which has one main flow(start), and 2 sub flows. Main start flow is just to get property information, that is needed for both sub flows. After getting property info, it needs to subscribe different sub flows(startFlow1, startFlow2). And these different sub flows have to work in different times. See the example implementation below;
@Bean(name = PollerMetadata.DEFAULT_POLLER)
public PollerMetadata poller() {
return Pollers.fixedRate(300, TimeUnit.SECONDS, 10).get();
}
@Bean
QueueChannel queueChannel() {
return new QueueChannel(1);
}
@Bean
public IntegrationFlow start() {
return IntegrationFlows
.from("propertyCredential")
.split()
.publishSubscribeChannel(c -> c
.subscribe(startFlow1())
.subscribe(startFlow2()))
.get();
}
@Bean
public IntegrationFlow startFlow1() {
return IntegrationFlows
.from(queueChannel())
.bridge(e -> e.poller(60, TimeUnit.SECONDS, 10))
.transform()...
.get();
}
@Bean
public IntegrationFlow startFlow2() {
return IntegrationFlows
.from(queueChannel())
.bridge(e -> e.poller(30, TimeUnit.SECONDS, 10))
.transform()...
.get();
}
In my implementation, sub flows are following the default poller's specification. What is best solution for such cases?
来源:https://stackoverflow.com/questions/61936422/how-to-use-pollerspec-in-integrationflowdefinition-bridge-properly-with-poller