INT-1493 poslishing, added comment to SPCAFB about why 1 should be a default maxMessagesPerPoll, change assertion for BF in APE only when it is absolutely required
This commit is contained in:
@@ -126,6 +126,8 @@ public class SourcePollingChannelAdapterFactoryBean implements FactoryBean<Sourc
|
||||
+ this.beanName + "', and no default poller is available within the context.");
|
||||
}
|
||||
if (this.pollerMetadata.getMaxMessagesPerPoll() < 1){
|
||||
// the default is 1 since a source might return
|
||||
// a non-null and non-interruptable value every time it is invoked
|
||||
this.pollerMetadata.setMaxMessagesPerPoll(1);
|
||||
}
|
||||
spca.setPollerMetadata(this.pollerMetadata);
|
||||
|
||||
@@ -84,7 +84,6 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
|
||||
return;
|
||||
}
|
||||
Assert.notNull(this.pollerMetadata.getTrigger(), "Trigger is required");
|
||||
Assert.notNull(this.getBeanFactory(), "BeanFactory is required");
|
||||
TaskExecutor providedExecutor = this.pollerMetadata.getTaskExecutor();
|
||||
if (providedExecutor != null) {
|
||||
this.taskExecutor = providedExecutor;
|
||||
@@ -92,6 +91,7 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
|
||||
if (this.taskExecutor != null) {
|
||||
if (!(this.taskExecutor instanceof ErrorHandlingTaskExecutor)) {
|
||||
if (this.errorHandler == null) {
|
||||
Assert.notNull(this.getBeanFactory(), "BeanFactory is required");
|
||||
this.errorHandler = new MessagePublishingErrorHandler(
|
||||
new BeanFactoryChannelResolver(getBeanFactory()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user