Merge remote-tracking branch 'upstream/master' into 4.0.0-WIP
Conflicts: spring-integration-core/src/main/java/org/springframework/integration/core/MessagingTemplate.java Resolved.
This commit is contained in:
@@ -28,6 +28,7 @@ import org.springframework.integration.file.tail.ApacheCommonsFileTailingMessage
|
||||
import org.springframework.integration.file.tail.FileTailingMessageProducerSupport;
|
||||
import org.springframework.integration.file.tail.OSDelegatingFileTailingMessageProducer;
|
||||
import org.springframework.scheduling.TaskScheduler;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
@@ -67,7 +68,9 @@ public class FileTailInboundChannelAdapterFactoryBean extends AbstractFactoryBea
|
||||
private volatile ApplicationEventPublisher applicationEventPublisher;
|
||||
|
||||
public void setNativeOptions(String nativeOptions) {
|
||||
this.nativeOptions = nativeOptions;
|
||||
if (StringUtils.hasText(nativeOptions)) {
|
||||
this.nativeOptions = nativeOptions;
|
||||
}
|
||||
}
|
||||
|
||||
public void setFile(File file) {
|
||||
@@ -82,11 +85,11 @@ public class FileTailInboundChannelAdapterFactoryBean extends AbstractFactoryBea
|
||||
this.taskScheduler = taskScheduler;
|
||||
}
|
||||
|
||||
public void setDelay(long delay) {
|
||||
public void setDelay(Long delay) {
|
||||
this.delay = delay;
|
||||
}
|
||||
|
||||
public void setFileDelay(long fileDelay) {
|
||||
public void setFileDelay(Long fileDelay) {
|
||||
this.fileDelay = fileDelay;
|
||||
}
|
||||
|
||||
@@ -107,11 +110,11 @@ public class FileTailInboundChannelAdapterFactoryBean extends AbstractFactoryBea
|
||||
this.outputChannel = outputChannel;
|
||||
}
|
||||
|
||||
public void setAutoStartup(boolean autoStartup) {
|
||||
public void setAutoStartup(Boolean autoStartup) {
|
||||
this.autoStartup = autoStartup;
|
||||
}
|
||||
|
||||
public void setPhase(int phase) {
|
||||
public void setPhase(Integer phase) {
|
||||
this.phase = phase;
|
||||
}
|
||||
|
||||
@@ -180,9 +183,8 @@ public class FileTailInboundChannelAdapterFactoryBean extends AbstractFactoryBea
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (this.nativeOptions != null && StringUtils.hasText(this.nativeOptions) && logger.isWarnEnabled()) {
|
||||
logger.warn("'native-options' are ignored with an Apache commons-io 'Tailer' adapter");
|
||||
}
|
||||
Assert.isTrue(this.nativeOptions == null,
|
||||
"'native-options' is not allowed with 'delay', 'end', or 'reopen'");
|
||||
adapter = new ApacheCommonsFileTailingMessageProducer();
|
||||
if (this.delay != null) {
|
||||
((ApacheCommonsFileTailingMessageProducer) adapter).setPollingDelay(this.delay);
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
xmlns:int-file="http://www.springframework.org/schema/integration/file"
|
||||
xmlns:task="http://www.springframework.org/schema/task"
|
||||
xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:util="http://www.springframework.org/schema/util"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
|
||||
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
|
||||
|
||||
<int-file:tail-inbound-channel-adapter id="default"
|
||||
channel="input"
|
||||
@@ -24,17 +28,28 @@
|
||||
file-delay="456"
|
||||
file="/tmp/foo"
|
||||
auto-startup="false"
|
||||
delay="${empty}"
|
||||
end="${empty}"
|
||||
reopen="${empty}"
|
||||
phase="123" />
|
||||
|
||||
<int-file:tail-inbound-channel-adapter id="apacheDefault"
|
||||
channel="input"
|
||||
native-options="${empty}"
|
||||
task-executor="exec"
|
||||
file="/tmp/bar"
|
||||
delay="2000"
|
||||
delay="${foo}"
|
||||
file-delay="10000"
|
||||
auto-startup="false"
|
||||
phase="123" />
|
||||
|
||||
<context:property-placeholder properties-ref="props"/>
|
||||
|
||||
<util:properties id="props">
|
||||
<prop key="foo">2000</prop>
|
||||
<prop key="empty"></prop>
|
||||
</util:properties>
|
||||
|
||||
<int-file:tail-inbound-channel-adapter id="apacheEndReopen"
|
||||
channel="input"
|
||||
task-executor="exec"
|
||||
|
||||
@@ -45,10 +45,10 @@ import org.springframework.integration.file.tail.FileTailingMessageProducerSuppo
|
||||
*/
|
||||
public class FileTailingMessageProducerTests {
|
||||
|
||||
private static final String TAIL_OPTIONS_FOLLOW_NAME_MANY_LINES = "-F -n 99999999";
|
||||
private static final String TAIL_OPTIONS_FOLLOW_NAME_ALL_LINES = "-F -n +0";
|
||||
|
||||
@Rule
|
||||
public TailRule tailRule = new TailRule(TAIL_OPTIONS_FOLLOW_NAME_MANY_LINES);
|
||||
public TailRule tailRule = new TailRule(TAIL_OPTIONS_FOLLOW_NAME_ALL_LINES);
|
||||
|
||||
private final Log logger = LogFactory.getLog(this.getClass());
|
||||
|
||||
@@ -76,7 +76,7 @@ public class FileTailingMessageProducerTests {
|
||||
@TailAvailable
|
||||
public void testOS() throws Exception {
|
||||
OSDelegatingFileTailingMessageProducer adapter = new OSDelegatingFileTailingMessageProducer();
|
||||
adapter.setOptions(TAIL_OPTIONS_FOLLOW_NAME_MANY_LINES);
|
||||
adapter.setOptions(TAIL_OPTIONS_FOLLOW_NAME_ALL_LINES);
|
||||
testGuts(adapter, "reader");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user