[ 
https://issues.apache.org/jira/browse/CAMEL-10283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15460857#comment-15460857
 ] 

Jeremy edited comment on CAMEL-10283 at 9/3/16 3:29 PM:
--------------------------------------------------------

Should be line 99 in WebSocketProducer.class

websocket.getConnection().sendMessage((String)message);

By looking at the jetty documentation, I couldn't find any request timeout, but 
it seems that we could use the async send method instead of the blocking one -> 
https://www.eclipse.org/jetty/documentation/9.4.x/jetty-websocket-api-send-message.html

I couldn't find the jetty implementation in the code, just seeing interfaces.

I will have a look at AHC-WS.

Thanks.

EDIT:

Unfortunately I've been unable to run ahc-ws with a simple route :

 from("ahc-ws://localhost:"+websocketPort)
                .routeId("websocket")....

Keep getting camel context shut down just after start:

2016-09-03 16:46:09 INFO  WsEndpoint:161 - Reconnecting websocket: 
ws://localhost:9292
2016-09-03 16:46:10 INFO  DefaultCamelContext:3066 - Apache Camel 2.17.2 
(CamelContext: camel-1) is shutting down

DefaultCamelContext is catching exception line 2858:

java.util.concurrent.ExecutionException: java.net.ConnectException: Connection 
refused: no further information





was (Author: sufod):
Should be line 99 in WebSocketProducer.class

websocket.getConnection().sendMessage((String)message);

By looking at the jetty documentation, I couldn't find any request timeout, but 
it seems that we could use the async send method instead of the blocking one -> 
https://www.eclipse.org/jetty/documentation/9.4.x/jetty-websocket-api-send-message.html

I couldn't find the jetty implementation in the code, just seeing interfaces.

I will have a look at AHC-WS.

Thanks.

> Add a timeout on WebSocketProducer sendMessages method
> ------------------------------------------------------
>
>                 Key: CAMEL-10283
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10283
>             Project: Camel
>          Issue Type: Wish
>          Components: camel-websocket
>    Affects Versions: 2.17.2
>         Environment: Ubuntu 14.04, full java project using camel-websockets
>            Reporter: Jeremy
>            Priority: Critical
>
> We are encountering a problem with websocket component when our clients using 
> web browsers are brutally loosing connection (closing laptop most of time).
> When we are sending updates from server to all clients, the WebSocketProducer 
> iterate over all opened sockets and when it reaches the broken socket, it is 
> just waiting for the idleTimeout to happen.
> At this step, the others clients are not able to interact with the server 
> anymore cause the websocket producer is busy waiting on the broken socket and 
> can't send messages to other clients.
> I'm looking for a work-around or something... maybe the ability to set a 
> timeout on the client handshake when sending... I'm not an expert in network 
> protocols.
> Thanks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to