[
https://issues.apache.org/jira/browse/CAMEL-7612?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14070029#comment-14070029
]
Claus Ibsen commented on CAMEL-7612:
------------------------------------
Camel sets that option on Jetty.
{code}
if (endpoint.getMaxIdleTime() != null) {
context.setInitParameter("maxIdleTime",
endpoint.getMaxIdleTime().toString());
}
{code}
And jetty documents that option in their javadoc at:
org.eclipse.jetty.server.AbstractConnector#setMaxIdleTime
{code}
/* ------------------------------------------------------------ */
/**
* Set the maximum Idle time for a connection, which roughly translates to
the {@link Socket#setSoTimeout(int)} call, although with NIO implementations
* other mechanisms may be used to implement the timeout. The max idle time
is applied:
* <ul>
* <li>When waiting for a new request to be received on a connection</li>
* <li>When reading the headers and content of a request</li>
* <li>When writing the headers and content of a response</li>
* </ul>
* Jetty interprets this value as the maximum time between some progress
being made on the connection. So if a single byte is read or written, then the
* timeout (if implemented by jetty) is reset. However, in many instances,
the reading/writing is delegated to the JVM, and the semantic is more strictly
* enforced as the maximum time a single read/write operation can take.
Note, that as Jetty supports writes of memory mapped file buffers, then a write
may
* take many 10s of seconds for large content written to a slow device.
* <p>
* Previously, Jetty supported separate idle timeouts and IO operation
timeouts, however the expense of changing the value of soTimeout was
significant, so
* these timeouts were merged. With the advent of NIO, it may be possible
to again differentiate these values (if there is demand).
*
* @param maxIdleTime
* The maxIdleTime to set.
*/
public void setMaxIdleTime(int maxIdleTime)
{
_maxIdleTime = maxIdleTime;
}
{code}
> Setting maxIdleTime in endpoint
> -------------------------------
>
> Key: CAMEL-7612
> URL: https://issues.apache.org/jira/browse/CAMEL-7612
> Project: Camel
> Issue Type: Bug
> Components: camel-websocket
> Affects Versions: 2.12.3
> Environment: Linux CentOS 6.5, OpenJDK 1.7.0.55.x86_64, WebBrowser:
> Chromium 31.0.1650.63, ServiceMix 5.0.0
> Reporter: Daniel Tremblay
> Priority: Minor
>
> I created a camel-websocket endpoint with this uri:
> websocket:/alerts?maxIdleTime=30000.
> The websocket is successfully created on the browser and messages can flow
> back and forth. The maxIdleTime should be 30 seconds. However it times out
> at 300 seconds (5 minutes).
> My initial goal was to set the timeout to 15 minutes, instead of the default
> 5 minutes, but changing this setting does not seem to change the default.
> I've modified the camel-websocket component to set the maxIdleTime on the
> controller, but this doesn't work either. I'm not sure if the error is in
> Jetty or Camel.
--
This message was sent by Atlassian JIRA
(v6.2#6252)