PollingSourceAdapter does schedule tasks when connected to a SynchronousChannel (INT-187).
This commit is contained in:
@@ -39,6 +39,7 @@ public class ByteStreamSourceAdapterTests {
|
||||
MessageChannel channel = new SimpleChannel();
|
||||
ByteStreamSourceAdapter adapter = new ByteStreamSourceAdapter(stream);
|
||||
adapter.setChannel(channel);
|
||||
adapter.setInitialDelay(10000);
|
||||
adapter.start();
|
||||
int count = adapter.processMessages();
|
||||
assertEquals(1, count);
|
||||
@@ -62,6 +63,7 @@ public class ByteStreamSourceAdapterTests {
|
||||
MessageChannel channel = new SimpleChannel();
|
||||
ByteStreamSourceAdapter adapter = new ByteStreamSourceAdapter(stream);
|
||||
adapter.setChannel(channel);
|
||||
adapter.setInitialDelay(10000);
|
||||
adapter.setBytesPerMessage(8);
|
||||
adapter.setMaxMessagesPerTask(5);
|
||||
adapter.start();
|
||||
|
||||
@@ -121,13 +121,6 @@ public class PollingSourceAdapter<T> extends AbstractSourceAdapter<T> implements
|
||||
if (!this.isInitialized()) {
|
||||
this.afterPropertiesSet();
|
||||
}
|
||||
if (this.getChannel() instanceof SynchronousChannel) {
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("source adapter configured on synchronous channel, not scheduling");
|
||||
}
|
||||
this.running = true;
|
||||
return;
|
||||
}
|
||||
if (this.scheduler == null) {
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("no task scheduler has been provided, will create one");
|
||||
|
||||
Reference in New Issue
Block a user