Open
Description
I have a Java client subscribing to a topic and the client has the socket closed after 5 minutes. I was expecting my client to have a persistent connection until it ended the session (maybe this is not the intended use for consumer?)The jetty socket default is that time. The service log shows
[DEBUG] 2015-05-21 13:43:50,319 org.eclipse.jetty.io.IdleTimeout checkIdleTimeout - SelectChannelEndPoint@7915e83{/192.168.80.1:63140<->7080,Open,in,out,R,-,300000,WebSocketServerConnection}{io=1,kio=1,kro=1} idle timeout check, elapsed: 300001 ms, remaining: -1 ms
[DEBUG] 2015-05-21 13:43:50,319 org.eclipse.jetty.io.IdleTimeout checkIdleTimeout - SelectChannelEndPoint@7915e83{/192.168.80.1:63140<->7080,Open,in,out,R,-,300000,WebSocketServerConnection}{io=1,kio=1,kro=1} idle timeout expired
I tried adding connector.setIdleTimeout(-1) to KafkaWebsocketServer.java but that did not change the result. The code I added looks like this:
public void run() {
try {
Server server = new Server();
ServerConnector connector = new ServerConnector(server);
connector.setPort(Integer.parseInt(wsProps.getProperty("ws.port", DEFAULT_PORT)));
connector.setIdleTimeout(-1);
Maybe the version of Jetty does not support infinite? I did find this article and the code shows a slightly different way of setting the server timeout but the comment at the bottom indicates what I did as the best result.
Metadata
Metadata
Assignees
Labels
No labels