diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/registry/ChannelRegistry.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/registry/ChannelRegistry.java index 22a14da11c..6cc15c015d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/registry/ChannelRegistry.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/channel/registry/ChannelRegistry.java @@ -42,7 +42,7 @@ public interface ChannelRegistry { /** * Create a tap on an already registered inbound channel - * @param the registered name + * @param name the registered name * @param channel the channel that will receive messages from the tap */ void tap(String name, MessageChannel channel); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java b/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java index a94c6e6da2..92b4a4baad 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/tail/FileTailingMessageProducerSupport.java @@ -79,7 +79,7 @@ public abstract class FileTailingMessageProducerSupport extends MessageProducerS /** * The delay in milliseconds between attempts to tail a non-existent file, * or between attempts to execute a process if it fails for any reason. - * @param missingFileDelay the delay. + * @param tailAttemptsDelay the delay. */ public void setTailAttemptsDelay(long tailAttemptsDelay) { Assert.isTrue(tailAttemptsDelay > 0, "'tailAttemptsDelay' must be > 0"); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/tail/OSDelegatingFileTailingMessageProducer.java b/spring-integration-file/src/main/java/org/springframework/integration/file/tail/OSDelegatingFileTailingMessageProducer.java index 16c0ec26ad..317857677b 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/tail/OSDelegatingFileTailingMessageProducer.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/tail/OSDelegatingFileTailingMessageProducer.java @@ -209,14 +209,18 @@ public class OSDelegatingFileTailingMessageProducer extends FileTailingMessagePr } } catch (IOException e) { - logger.error("Exception on tail error reader", e); + if (logger.isDebugEnabled()) { + logger.debug("Exception on tail error reader", e); + } } finally { try { errorReader.close(); } catch (IOException e) { - logger.error("Exception while closing stderr", e); + if (logger.isDebugEnabled()) { + logger.debug("Exception while closing stderr", e); + } } } } @@ -238,12 +242,16 @@ public class OSDelegatingFileTailingMessageProducer extends FileTailingMessagePr } } catch (IOException e) { - logger.error("Exception on tail reader", e); + if (logger.isDebugEnabled()) { + logger.debug("Exception on tail reader", e); + } try { this.reader.close(); } catch (IOException e1) { - + if (logger.isDebugEnabled()) { + logger.debug("Exception while closing stdout", e); + } } this.destroyProcess(); } diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/tail/FileTailingMessageProducerTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/tail/FileTailingMessageProducerTests.java index 238de37e99..694fb680ab 100644 --- a/spring-integration-file/src/test/java/org/springframework/integration/file/tail/FileTailingMessageProducerTests.java +++ b/spring-integration-file/src/test/java/org/springframework/integration/file/tail/FileTailingMessageProducerTests.java @@ -116,13 +116,14 @@ public class FileTailingMessageProducerTests { foo.write(("hello" + i + "\n").getBytes()); } foo.flush(); + foo.close(); for (int i = 0; i < 50; i++) { Message message = outputChannel.receive(5000); assertNotNull("expected a non-null message", message); assertEquals("hello" + i, message.getPayload()); } file.renameTo(renamed); - foo.close(); + file = new File(testDir, "foo"); foo = new FileOutputStream(file); if (adapter instanceof ApacheCommonsFileTailingMessageProducer) { Thread.sleep(1000); @@ -131,12 +132,12 @@ public class FileTailingMessageProducerTests { foo.write(("hello" + i + "\n").getBytes()); } foo.flush(); + foo.close(); for (int i = 50; i < 100; i++) { - Message message = outputChannel.receive(3000); + Message message = outputChannel.receive(10000); assertNotNull("expected a non-null message", message); assertEquals("hello" + i, message.getPayload()); } - foo.close(); } private void waitForField(FileTailingMessageProducerSupport adapter, String field) throws Exception {