camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ekz <ekizo...@gmail.com>
Subject Re: FTP Reconnect attempt problem
Date Thu, 09 Apr 2015 12:41:24 GMT
Hi,

How it is meaningful to put that "Thread.sleep(reconnectDelay)" to
CustomPollStrategy instead of the one in SftpOperations class ?

public class CustomPollStrategy extends
RemoteFilePollingConsumerPollStrategy { 

    @Override 
    public synchronized boolean rollback(Consumer consumer, Endpoint
endpoint, int retryCounter, Exception cause) throws Exception { 

        //retry 3 times 
        if(retryCounter <= 2) { 
            //force disconnect 
            super.rollback(consumer, endpoint, retryCounter, cause);             
            return true; 
        } 
        else { 
            //give up retry and wait for the next connection attempt. 
            *try {
                Thread.sleep(((RemoteFileEndpoint)
endpoint).getReconnectDelay());
            } catch (Exception e) {
            }*
            return false; 
        }         
    } 
}

Does it have a negative impact on another place of the camel?
Thanks in advance.



--
View this message in context: http://camel.465427.n5.nabble.com/FTP-Reconnect-attempt-problem-tp5765466p5765513.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message