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

michael elbaz commented on CAMEL-14224:
---------------------------------------

I know tests are passed using maven but for my point it must be passed when 
using an IDE also, by the way you can just open your component when you are 
using an ide and not the whole project 

> Camel-Websocket: The sendToAll method in the Producer is really slow
> --------------------------------------------------------------------
>
>                 Key: CAMEL-14224
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14224
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-websocket
>    Affects Versions: 2.24.2
>         Environment: 
>            Reporter: michael elbaz
>            Priority: Major
>             Fix For: 3.1.0
>
>
> I don't know what the idea behind but in this class 
> ([Producer|https://github.com/apache/camel/blob/master/components/camel-websocket/src/main/java/org/apache/camel/component/websocket/WebsocketProducer.java])
>  sendToAll method the Thread.sleep in the while loop make all the process 
> crazy slow just try to run this code
> {code:java}
>     @Override
>     public void configure() throws Exception {
>         String uri = 
> "websocket://127.0.0.1:8443/test?sendToAll=true&sendTimeout=0";
>         from(uri).to(uri);
>     }
> {code}
> and send multiple message to the server and you will see how slow is it for 
> my point there is two defect:
> # Give the availability to send to all *expect* the sender
> # Fix the while loop
> During my test to have decent performance i set this parameter `sendTimeout` 
> to 0 but i got this exception then: 
> {code:java}
> org.apache.camel.component.websocket.WebsocketSendException: Failed to 
> deliver message within 0 millis to one or more recipients.. 
> Exchange[ID-DESKTOP-S8PM2C4-1574865248397-0-3]
>       at 
> org.apache.camel.component.websocket.WebsocketProducer.sendToAll(WebsocketProducer.java:149)
>  ~[camel-websocket-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.component.websocket.WebsocketProducer.process(WebsocketProducer.java:52)
>  ~[camel-websocket-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
>  ~[camel-core-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148) 
> [camel-core-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
>  [camel-core-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
>  [camel-core-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
>  [camel-core-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:76)
>  [camel-core-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:148) 
> [camel-core-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:548)
>  [camel-core-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
>  [camel-core-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:201)
>  [camel-core-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.component.websocket.WebsocketConsumer.sendMessage(WebsocketConsumer.java:75)
>  [camel-websocket-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.component.websocket.WebsocketConsumer.sendMessage(WebsocketConsumer.java:59)
>  [camel-websocket-2.24.2.jar:2.24.2]
>       at 
> org.apache.camel.component.websocket.DefaultWebsocket.onMessage(DefaultWebsocket.java:66)
>  [camel-websocket-2.24.2.jar:2.24.2]
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
> ~[na:1.8.0_201]
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
> ~[na:1.8.0_201]
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  ~[na:1.8.0_201]
>       at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
>       at 
> org.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:70)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.events.annotated.OptionalSessionCallableMethod.call(OptionalSessionCallableMethod.java:72)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver.onTextMessage(JettyAnnotatedEventDriver.java:251)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.message.SimpleTextMessage.messageComplete(SimpleTextMessage.java:69)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.events.AbstractEventDriver.appendMessage(AbstractEventDriver.java:65)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver.onTextFrame(JettyAnnotatedEventDriver.java:243)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.events.AbstractEventDriver.incomingFrame(AbstractEventDriver.java:150)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.WebSocketSession.incomingFrame(WebSocketSession.java:322)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.extensions.AbstractExtension.nextIncomingFrame(AbstractExtension.java:147)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.extensions.compress.PerMessageDeflateExtension.nextIncomingFrame(PerMessageDeflateExtension.java:112)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.extensions.compress.CompressExtension.forwardIncoming(CompressExtension.java:168)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.extensions.compress.PerMessageDeflateExtension.incomingFrame(PerMessageDeflateExtension.java:92)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.extensions.ExtensionStack.incomingFrame(ExtensionStack.java:202)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.Parser.notifyFrame(Parser.java:225) 
> [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.Parser.parseSingleFrame(Parser.java:259) 
> [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:460)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.websocket.common.io.AbstractWebSocketConnection.onFillable(AbstractWebSocketConnection.java:441)
>  [websocket-common-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
>  [jetty-io-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) 
> [jetty-io-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117) 
> [jetty-io-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
>  [jetty-util-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
>  [jetty-util-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
>  [jetty-util-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
>  [jetty-util-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:388)
>  [jetty-util-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806)
>  [jetty-util-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938)
>  [jetty-util-9.4.22.v20191022.jar:9.4.22.v20191022]
>       at java.lang.Thread.run(Thread.java:748) [na:1.8.0_201]
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to