spca.setMaxMessagesPerPoll(this.pollerMetadata.getMaxMessagesPerPoll()); if (this.sendTimeout != null) { spca.setSendTimeout(this.sendTimeout);
adapter.setSource(source); adapter.setTaskScheduler(scheduler); adapter.setMaxMessagesPerPoll(3); adapter.setTrigger(new PeriodicTrigger(60000)); adapter.setOutputChannel(channel);
@Override protected void onInit() { Assert.notNull(this.source, "source must not be null"); Assert.notNull(this.outputChannel, "outputChannel must not be null"); if (this.maxMessagesPerPoll < 0) { // the default is 1 since a source might return // a non-null value every time it is invoked this.setMaxMessagesPerPoll(1); } super.onInit(); }
private void initializeAdapter() { synchronized (this.initializationMonitor) { if (this.initialized) { return; } Assert.notNull(this.source, "source is required"); Assert.notNull(this.outputChannel, "outputChannel is required"); SourcePollingChannelAdapter spca = new SourcePollingChannelAdapter(); spca.setSource(this.source); spca.setOutputChannel(this.outputChannel); if (this.pollerMetadata == null) { this.pollerMetadata = IntegrationContextUtils.getDefaultPollerMetadata(this.beanFactory); Assert.notNull(this.pollerMetadata, "No poller has been defined for channel-adapter '" + this.beanName + "', and no default poller is available within the context."); } spca.setTrigger(this.pollerMetadata.getTrigger()); spca.setMaxMessagesPerPoll(this.pollerMetadata.getMaxMessagesPerPoll()); spca.setTaskExecutor(this.pollerMetadata.getTaskExecutor()); spca.setTransactionManager(this.pollerMetadata.getTransactionManager()); spca.setTransactionDefinition(this.pollerMetadata.getTransactionDefinition()); spca.setAdviceChain(this.pollerMetadata.getAdviceChain()); spca.setAutoStartup(this.autoStartup); spca.setBeanName(this.beanName); spca.setBeanFactory(this.beanFactory); spca.setBeanClassLoader(this.beanClassLoader); spca.afterPropertiesSet(); this.adapter = spca; this.initialized = true; } }
spca.setMaxMessagesPerPoll(this.pollerMetadata.getMaxMessagesPerPoll()); if (this.sendTimeout != null) { spca.setSendTimeout(this.sendTimeout);