Project

General

Profile

« Previous | Next » 

Revision d9511145

Added by Andreas Kohlbecker about 4 years ago

ref #8812 connect request timeouts and more doc on timeouts

View differences:

eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/CdmApplicationRemoteConfiguration.java
106 106
public class CdmApplicationRemoteConfiguration implements ICdmRepository, ApplicationContextAware  {
107 107

  
108 108
    /**
109
     * Timeout for service lookup etc. This timeout should me more
109
     * Timeout for service lookup etc. This timeout (milliseconds) should me more
110 110
     * strict than {@link #HTTP_READ_TIMEOUT} to avoid connecting to
111 111
     * cdm servers when the network quality is too bad.
112
     *
112 113
     */
113
    public static final int HTTP_READ_TIMEOUT_MIN = 300;
114
    public static final int HTTP_READ_TIMEOUT_MIN = 1000; // one minute
115

  
114 116
    /**
115
     * Timeout for normal operation
117
     * Timeout for normal operation (milliseconds)
118
     *
119
     * Infinite time out (value = 0) can cause the application to be stuck in
120
     * SocketInputStream.read(), Therefore it makes sense to specify a definite
121
     * timeout which is high enough to allow for longer operations
122
     * <p>
123
     * The application should be usable in networks with low connection quality,
124
     * e.g.: from cuba where the throughput rate is low (<= ISDN speed, 64 kbit)
125
     * and a packet delay of <200 ms. Additionally we should tolerate a certain
126
     * amount of packet loss. Here we take the packet loss rate as it occurs
127
     * in the FU-Berlin ZEDAT VPN as reference case (~1%)
128
     * <ul>
129
     * <li>5min: Timeout at remoting/taxonnode.service
130
     * </ul>
131
     *
116 132
     */
117
    public static final int HTTP_READ_TIMEOUT = 0;
133
    public static final int HTTP_READ_TIMEOUT = 70000;
118 134

  
119 135
    @SuppressWarnings("unused")
120 136
    private static final Logger logger = Logger.getLogger(CdmApplicationRemoteConfiguration.class);
......
170 186
        proxyFactory.setServiceUrl(baseUrl + serviceSuffix);
171 187
        if(executor != null) {
172 188
            executor.setReadTimeout(HTTP_READ_TIMEOUT);
189
            executor.setConnectionRequestTimeout(HTTP_READ_TIMEOUT);
173 190
            proxyFactory.setHttpInvokerRequestExecutor(executor);
174 191
        }
175 192
        if(ITermService.class.isAssignableFrom(clazz)){

Also available in: Unified diff