[
https://issues.apache.org/jira/browse/CAMEL-9512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-9512.
--------------------------------
Resolution: Invalid
Assignee: Claus Ibsen
Yes use the user mailing list to get help first as we say
http://camel.apache.org/support.html
Also try upgrading and testing with newer versions of Camel and what is
suggested on that page
And mind Camel 2.14 is EOL.
> camel-ftp - Recover from lost connection issue
> ----------------------------------------------
>
> Key: CAMEL-9512
> URL: https://issues.apache.org/jira/browse/CAMEL-9512
> Project: Camel
> Issue Type: Bug
> Components: camel-sftp
> Affects Versions: 2.14.1
> Reporter: omar attari
> Assignee: Claus Ibsen
>
> Dears,
> we are using the sftp camel route service but for unknown reasons ths sftp
> camel service was stop polling any file from sftp server then we need to
> restart the service again to polling the files again.
> This condition occurs daily we need your assistent to solve it.
> public class SftpRoutesBuilder
> extends RouteBuilder
> {
> private static final Logger LOGGER =
> LoggerFactory.getLogger(SftpRoutesBuilder.class);
> private String protocol;
> private String username;
> private String password;
> private String requestUri;
> private String inProcessUri;
> private boolean passiveMode;
> private boolean binary;
> private String routeId;
> private String fileOwnerBicCode;
> private String filePurpose;
> private String privateKey;
> private String privateKeyPassphrase;
>
> public void configure()
> throws Exception
> {
> LOGGER.info("configuring the ftp routes builder");
>
> errorHandler(loggingErrorHandler(LOGGER).level(LoggingLevel.INFO));
> if ((this.privateKey != null) && (this.password != null) &&
> (this.privateKeyPassphrase == null)) {
>
> ((RouteDefinition)((RouteDefinition)((RouteDefinition)((ProcessorDefinition)((ProcessorDefinition)((ProcessorDefinition)from(MessageFormat.format("{0}://{1}@{2}?password={3}&passiveMode={4}&binary={5}&privateKey={6}",
> new Object[] { this.protocol, this.username, this.requestUri, this.password,
> Boolean.valueOf(this.passiveMode), Boolean.valueOf(this.binary),
> this.privateKey }) + "&delay=60000&delete=true&" +
> "maximumReconnectAttempts=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.maximum.reconnect.attempts")
> + "&reconnectDelay=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.reconnect.delay") +
> "&disconnect=" +
> PropertiesLoader.getInstance().getPropertyValue("disconnect.route")).setProperty("fileName").simple("CamelFileName")).setProperty("fileOwnerBicCode").simple(this.fileOwnerBicCode)).setProperty("filePurpose").simple(this.filePurpose)).to(MessageFormat.format("{0}://{1}@{2}?password={3}&passiveMode={4}&binary={5}&privateKey={6}",
> new Object[] { this.protocol, this.username, this.inProcessUri,
> this.password, Boolean.valueOf(this.passiveMode),
> Boolean.valueOf(this.binary), this.privateKey }) +
> "&maximumReconnectAttempts=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.maximum.reconnect.attempts")
> + "&reconnectDelay=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.reconnect.delay") +
> "&disconnect=" +
> PropertiesLoader.getInstance().getPropertyValue("disconnect.route"))).convertBodyTo(byte[].class)).process(new
> FtpFilesProcessor())).routeId(this.routeId);
> } else if ((this.privateKey != null) && (this.password == null) &&
> (this.privateKeyPassphrase == null)) {
>
> ((RouteDefinition)((RouteDefinition)((RouteDefinition)((ProcessorDefinition)((ProcessorDefinition)((ProcessorDefinition)from(MessageFormat.format("{0}://{1}@{2}?passiveMode={3}&binary={4}&privateKey={5}",
> new Object[] { this.protocol, this.username, this.requestUri,
> Boolean.valueOf(this.passiveMode), Boolean.valueOf(this.binary),
> this.privateKey }) + "&delay=60000&delete=true&" +
> "maximumReconnectAttempts=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.maximum.reconnect.attempts")
> + "&reconnectDelay=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.reconnect.delay") +
> "&disconnect=" +
> PropertiesLoader.getInstance().getPropertyValue("disconnect.route")).setProperty("fileName").simple("CamelFileName")).setProperty("fileOwnerBicCode").simple(this.fileOwnerBicCode)).setProperty("filePurpose").simple(this.filePurpose)).to(MessageFormat.format("{0}://{1}@{2}?passiveMode={3}&binary={4}&privateKey={5}",
> new Object[] { this.protocol, this.username, this.inProcessUri,
> Boolean.valueOf(this.passiveMode), Boolean.valueOf(this.binary),
> this.privateKey }) + "&maximumReconnectAttempts=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.maximum.reconnect.attempts")
> + "&reconnectDelay=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.reconnect.delay") +
> "&disconnect=" +
> PropertiesLoader.getInstance().getPropertyValue("disconnect.route"))).convertBodyTo(byte[].class)).process(new
> FtpFilesProcessor())).routeId(this.routeId);
> } else if ((this.privateKey == null) && (this.password != null) &&
> (this.privateKeyPassphrase == null)) {
>
> ((RouteDefinition)((RouteDefinition)((RouteDefinition)((ProcessorDefinition)((ProcessorDefinition)((ProcessorDefinition)from(MessageFormat.format("{0}://{1}@{2}?password={3}&passiveMode={4}&binary={5}",
> new Object[] { this.protocol, this.username, this.password, this.requestUri,
> Boolean.valueOf(this.passiveMode), Boolean.valueOf(this.binary) }) +
> "&delay=60000&delete=true&" + "maximumReconnectAttempts=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.maximum.reconnect.attempts")
> + "&reconnectDelay=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.reconnect.delay") +
> "&disconnect=" +
> PropertiesLoader.getInstance().getPropertyValue("disconnect.route")).setProperty("fileName").simple("CamelFileName")).setProperty("fileOwnerBicCode").simple(this.fileOwnerBicCode)).setProperty("filePurpose").simple(this.filePurpose)).to(MessageFormat.format("{0}://{1}@{2}?password={3}&passiveMode={4}&binary={5}",
> new Object[] { this.protocol, this.username, this.password,
> this.inProcessUri, Boolean.valueOf(this.passiveMode),
> Boolean.valueOf(this.binary) }) + "&maximumReconnectAttempts=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.maximum.reconnect.attempts")
> + "&reconnectDelay=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.reconnect.delay") +
> "&disconnect=" +
> PropertiesLoader.getInstance().getPropertyValue("disconnect.route"))).convertBodyTo(byte[].class)).process(new
> FtpFilesProcessor())).routeId(this.routeId);
> } else if ((this.privateKey != null) && (this.password == null) &&
> (this.privateKeyPassphrase != null)) {
>
> ((RouteDefinition)((RouteDefinition)((RouteDefinition)((ProcessorDefinition)((ProcessorDefinition)((ProcessorDefinition)from(MessageFormat.format("{0}://{1}@{2}?passiveMode={3}&binary={4}&privateKey={5}&privateKeyPassphrase={6}",
> new Object[] { this.protocol, this.username, this.requestUri,
> Boolean.valueOf(this.passiveMode), Boolean.valueOf(this.binary),
> this.privateKey, this.privateKeyPassphrase }) + "&delay=60000&delete=true&" +
> "maximumReconnectAttempts=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.maximum.reconnect.attempts")
> + "&reconnectDelay=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.reconnect.delay") +
> "&disconnect=" +
> PropertiesLoader.getInstance().getPropertyValue("disconnect.route")).setProperty("fileName").simple("CamelFileName")).setProperty("fileOwnerBicCode").simple(this.fileOwnerBicCode)).setProperty("filePurpose").simple(this.filePurpose)).to(MessageFormat.format("{0}://{1}@{2}?passiveMode={3}&binary={4}&privateKey={5}&privateKeyPassphrase={6}",
> new Object[] { this.protocol, this.username, this.inProcessUri,
> Boolean.valueOf(this.passiveMode), Boolean.valueOf(this.binary),
> this.privateKey, this.privateKeyPassphrase }) + "&maximumReconnectAttempts="
> +
> PropertiesLoader.getInstance().getPropertyValue("ftp.maximum.reconnect.attempts")
> + "&reconnectDelay=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.reconnect.delay") +
> "&disconnect=" +
> PropertiesLoader.getInstance().getPropertyValue("disconnect.route"))).convertBodyTo(byte[].class)).process(new
> FtpFilesProcessor())).routeId(this.routeId);
> } else if ((this.privateKey != null) && (this.password != null) &&
> (this.privateKeyPassphrase != null)) {
>
> ((RouteDefinition)((RouteDefinition)((RouteDefinition)((ProcessorDefinition)((ProcessorDefinition)((ProcessorDefinition)from(MessageFormat.format("{0}://{1}@{2}?password={3}&passiveMode={4}&binary={5}&privateKey={6}&privateKeyPassphrase={7}",
> new Object[] { this.protocol, this.username, this.requestUri, this.password,
> Boolean.valueOf(this.passiveMode), Boolean.valueOf(this.binary),
> this.privateKey, this.privateKeyPassphrase }) + "&delay=60000&delete=true&" +
> "maximumReconnectAttempts=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.maximum.reconnect.attempts")
> + "&reconnectDelay=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.reconnect.delay") +
> "&disconnect=" +
> PropertiesLoader.getInstance().getPropertyValue("disconnect.route")).setProperty("fileName").simple("CamelFileName")).setProperty("fileOwnerBicCode").simple(this.fileOwnerBicCode)).setProperty("filePurpose").simple(this.filePurpose)).to(MessageFormat.format("{0}://{1}@{2}?password={3}&passiveMode={4}&binary={5}&privateKey={6}&privateKeyPassphrase={7}",
> new Object[] { this.protocol, this.username, this.inProcessUri,
> this.password, Boolean.valueOf(this.passiveMode),
> Boolean.valueOf(this.binary), this.privateKey, this.privateKeyPassphrase }) +
> "&maximumReconnectAttempts=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.maximum.reconnect.attempts")
> + "&reconnectDelay=" +
> PropertiesLoader.getInstance().getPropertyValue("ftp.reconnect.delay") +
> "&disconnect=" +
> PropertiesLoader.getInstance().getPropertyValue("disconnect.route"))).convertBodyTo(byte[].class)).process(new
> FtpFilesProcessor())).routeId(this.routeId);
> }
> }
>
> public SftpRoutesBuilder(String protocol, String username, String password,
> String requestUri, String inProcessUri, boolean passiveMode, boolean binary,
> String routeId, String fileOwnerBicCode, String filePurpose, String
> privateKey, String passPhrase)
> {
> this.protocol = protocol.toLowerCase();
> this.username = username;
> this.password = password;
> this.requestUri = requestUri;
> this.inProcessUri = inProcessUri;
> this.passiveMode = passiveMode;
> this.binary = binary;
> this.routeId = routeId;
> this.fileOwnerBicCode = fileOwnerBicCode;
> this.filePurpose = filePurpose;
> this.privateKey = privateKey;
> this.privateKeyPassphrase = passPhrase;
> }
>
> public SftpRoutesBuilder(String transferMethod, String username2, String
> password2, String requestUri2, String inProccessUri, String routeId, String
> fileOwnerBicCode, String filePurpose, String privateKey, String passPhrase)
> {
> this.protocol = transferMethod.toLowerCase();
> this.username = username2;
> this.password = password2;
> this.requestUri = requestUri2;
> this.inProcessUri = inProccessUri;
> this.passiveMode = Boolean.TRUE.booleanValue();
> this.binary = Boolean.TRUE.booleanValue();
> this.routeId = routeId;
> this.fileOwnerBicCode = fileOwnerBicCode;
> this.filePurpose = filePurpose;
> this.privateKey = privateKey;
> this.privateKeyPassphrase = passPhrase;
> }
>
> public SftpRoutesBuilder(String transferMethod, String username2, String
> password2, String requestUri2, String inProccessUri, String routeId, String
> fileOwnerBicCode, String filePurpose)
> {
> this.protocol = transferMethod.toLowerCase();
> this.username = username2;
> this.password = password2;
> this.requestUri = requestUri2;
> this.inProcessUri = inProccessUri;
> this.passiveMode = Boolean.TRUE.booleanValue();
> this.binary = Boolean.TRUE.booleanValue();
> this.routeId = routeId;
> this.fileOwnerBicCode = fileOwnerBicCode;
> this.filePurpose = filePurpose;
> this.privateKey = null;
> }
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)