Hi I dont think this "improvement" is a good idea.
Instead we have a ticket about allow to configure the scheduled poll consumers with backoff settings, so if there has been no succesfull polls after X time then the polling can backoff (eg slow down). So in this case with the "cannot connect" we could use the backoff to slow down so it does not run so frequently. https://issues.apache.org/jira/browse/CAMEL-6071 https://issues.apache.org/jira/browse/CAMEL-4876 There is monitoring tools that do log parsing. And with no more WARNs being logged the tooling can't detect that there is a problem still. I would like this change to be reverted as I think its wrong to hide the problem, and only log it once. And we do not do this in other components, so this will just take people by surprise that its "special" for ftp consumer only. On Tue, Jul 16, 2013 at 4:37 AM, <[email protected]> wrote: > CAMEL-6551 RemoteFileConsumer uust writing the warning message at the first > time. > > > Project: http://git-wip-us.apache.org/repos/asf/camel/repo > Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f3b03fb9 > Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f3b03fb9 > Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f3b03fb9 > > Branch: refs/heads/master > Commit: f3b03fb9336072675f1d44b74a11577a0f8ca929 > Parents: 19c966b > Author: Willem Jiang <[email protected]> > Authored: Tue Jul 16 10:35:24 2013 +0800 > Committer: Willem Jiang <[email protected]> > Committed: Tue Jul 16 10:35:24 2013 +0800 > > ---------------------------------------------------------------------- > .../camel/component/file/remote/RemoteFileConsumer.java | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > ---------------------------------------------------------------------- > > > http://git-wip-us.apache.org/repos/asf/camel/blob/f3b03fb9/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java > ---------------------------------------------------------------------- > diff --git > a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java > > b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java > index e347c7d..39e23ce 100644 > --- > a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java > +++ > b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileConsumer.java > @@ -28,6 +28,7 @@ import > org.apache.camel.component.file.GenericFileOperationFailedException; > */ > public abstract class RemoteFileConsumer<T> extends GenericFileConsumer<T> { > protected boolean loggedIn; > + protected boolean loggedInWarning; > > public RemoteFileConsumer(RemoteFileEndpoint<T> endpoint, Processor > processor, RemoteFileOperations<T> operations) { > super(endpoint, processor, operations); > @@ -66,10 +67,16 @@ public abstract class RemoteFileConsumer<T> extends > GenericFileConsumer<T> { > > if (!loggedIn) { > String message = "Cannot connect/login to: " + remoteServer() + > ". Will skip this poll."; > - log.warn(message); > + if (!loggedInWarning) { > + log.warn(message); > + loggedInWarning = true; > + } > return false; > + } else { > + // need to log the failed log again > + loggedInWarning = false; > } > - > + > return true; > } > > -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
