The default IntervalTrigger (with interval of 10ms) is being configured within the AbstractPollingEndpoint only. The ConsumerEndpointFactoryBean no longer provides a default trigger but rather only passes along a non-null trigger property if one is configured on the bean definition.

This commit is contained in:
Mark Fisher
2008-11-23 04:19:15 +00:00
parent 83e15fbb9b
commit f69d774e09
3 changed files with 3 additions and 7 deletions

View File

@@ -32,7 +32,6 @@ import org.springframework.integration.endpoint.AbstractEndpoint;
import org.springframework.integration.endpoint.EventDrivenConsumer;
import org.springframework.integration.endpoint.PollingConsumer;
import org.springframework.integration.message.MessageHandler;
import org.springframework.integration.scheduling.IntervalTrigger;
import org.springframework.integration.scheduling.Trigger;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionDefinition;
@@ -158,9 +157,6 @@ public class ConsumerEndpointFactoryBean implements FactoryBean, BeanFactoryAwar
this.endpoint = new EventDrivenConsumer((SubscribableChannel) channel, this.handler);
}
else if (channel instanceof PollableChannel) {
if (this.trigger == null) {
this.trigger = new IntervalTrigger(0);
}
PollingConsumer pollingConsumer = new PollingConsumer(
(PollableChannel) channel, this.handler);
pollingConsumer.setTrigger(this.trigger);

View File

@@ -138,7 +138,7 @@ public abstract class AbstractPollingEndpoint extends AbstractEndpoint implement
return;
}
if (this.trigger == null) {
this.trigger = new IntervalTrigger(0);
this.trigger = new IntervalTrigger(10);
}
if (this.transactionManager != null) {
if (this.transactionDefinition == null) {

View File

@@ -12,9 +12,9 @@
</si:channel>
<bean id="testEndpoint" class="org.springframework.integration.endpoint.PollingEndpointStub">
<property name="taskExecutor" ref="taskExecutor" />
<property name="taskExecutor" ref="taskExecutor"/>
</bean>
<si:thread-pool-task-executor id="taskExecutor" core-size="1" max-size="5" rejection-policy="CALLER_RUNS"/>
<si:thread-pool-task-executor id="taskExecutor" core-size="1" max-size="1" rejection-policy="CALLER_RUNS"/>
</beans>