codehaus


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: camel-websocket configure maxThreads


Hey Claus,

Thanks for responding so quickly! I did actually stumble upon the Component
configuration when reading through the Camel Spring documentation.

I've verified that the xml Component configuration works when running in a
virtual machine (virtualbox-5.2.22 / centos-7) configured with more than 1
core. However, the Component configuration appears to be ignored when
running in the same virtual machine configured with exactly 1 core. I'm not
sure if this is a bug or if I'm still doing something incorrectly.

For reference, this is the exact blueprint I'm using. I'll include the
exact error (seen on a machine with exactly 1 core) below.

############################################
# Blueprint
############################################

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";>
    <camelContext xmlns="http://camel.apache.org/schema/blueprint";>
        <route>
            <from uri="direct:echo" />
            <to uri="websocket:0.0.0.0:8081/echo" />
        </route>
    </camelContext>
    <bean id="WebsocketComponent"
class="org.apache.camel.component.websocket.WebsocketComponent">
        <property name="minThreads" value="1" />
        <property name="maxThreads" value="4" />
    </bean>
</blueprint>

############################################
# Error Log
############################################

org.eclipse.jetty.util.MultiException: Multiple exceptions

at
org.eclipse.jetty.util.MultiException.ifExceptionThrow(MultiException.java:124)
~[?:?]

at org.eclipse.jetty.server.Server.doStart(Server.java:409) ~[?:?]

at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
~[?:?]

at
org.apache.camel.component.websocket.WebsocketComponent.connect(WebsocketComponent.java:202)
~[?:?]

at
org.apache.camel.component.websocket.WebsocketEndpoint.connect(WebsocketEndpoint.java:123)
~[?:?]

at
org.apache.camel.component.websocket.WebsocketProducer.doStart(WebsocketProducer.java:84)
~[?:?]

at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
~[68:org.apache.camel.camel-core:2.23.0]

at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DeferServiceStartupListener.onCamelContextStarted(DeferServiceStartupListener.java:49)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3867)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3646)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3489)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3248)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3244)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3267)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3244)
~[68:org.apache.camel.camel-core:2.23.0]

at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3160)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:243)
~[66:org.apache.camel.camel-blueprint:2.23.0]

at
org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283)
~[66:org.apache.camel.camel-blueprint:2.23.0]

at
org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:177)
[66:org.apache.camel.camel-blueprint:2.23.0]

at
org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:190)
[47:org.apache.aries.blueprint.core:1.9.0]

at
org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:188)
[47:org.apache.aries.blueprint.core:1.9.0]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
[?:?]

at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
[?:?]

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[?:?]

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[?:?]

at java.lang.Thread.run(Thread.java:748) [?:?]

Suppressed: java.lang.IllegalStateException: Insufficient configured
threads: required=3 < max=3 for
QueuedThreadPool[CamelJettyWebSocketServer]@2a618a47{STARTED,1<=1<=3,i=1,q=0}[ReservedThreadExecutor@485685c4
{s=0/1,p=0}]

at
org.eclipse.jetty.util.thread.ThreadPoolBudget.check(ThreadPoolBudget.java:149)
~[?:?]

at
org.eclipse.jetty.util.thread.ThreadPoolBudget.leaseTo(ThreadPoolBudget.java:130)
~[?:?]

at
org.eclipse.jetty.util.thread.ThreadPoolBudget.leaseFrom(ThreadPoolBudget.java:175)
~[?:?]

at org.eclipse.jetty.io.SelectorManager.doStart(SelectorManager.java:251)
~[?:?]

at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
~[?:?]

at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
~[?:?]

at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
~[?:?]

at
org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:279)
~[?:?]

at
org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:81)
~[?:?]

at
org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:235)
~[?:?]

at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
~[?:?]

at org.eclipse.jetty.server.Server.doStart(Server.java:398) ~[?:?]

at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
~[?:?]

at
org.apache.camel.component.websocket.WebsocketComponent.connect(WebsocketComponent.java:202)
~[?:?]

at
org.apache.camel.component.websocket.WebsocketEndpoint.connect(WebsocketEndpoint.java:123)
~[?:?]

at
org.apache.camel.component.websocket.WebsocketProducer.doStart(WebsocketProducer.java:84)
~[?:?]

at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
~[68:org.apache.camel.camel-core:2.23.0]

at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DeferServiceStartupListener.onCamelContextStarted(DeferServiceStartupListener.java:49)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3867)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3646)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3489)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3248)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3244)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3267)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3244)
~[68:org.apache.camel.camel-core:2.23.0]

at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3160)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:243)
~[66:org.apache.camel.camel-blueprint:2.23.0]

at
org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283)
~[66:org.apache.camel.camel-blueprint:2.23.0]

at
org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:177)
[66:org.apache.camel.camel-blueprint:2.23.0]

at
org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:190)
[47:org.apache.aries.blueprint.core:1.9.0]

at
org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:188)
[47:org.apache.aries.blueprint.core:1.9.0]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
[?:?]

at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
[?:?]

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[?:?]

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[?:?]

at java.lang.Thread.run(Thread.java:748) [?:?]

Suppressed: java.lang.IllegalStateException: Insufficient configured
threads: required=4 < max=3 for
QueuedThreadPool[CamelJettyWebSocketServer]@2a618a47{STARTED,1<=1<=3,i=1,q=0}[ReservedThreadExecutor@485685c4
{s=0/1,p=0}]

at
org.eclipse.jetty.util.thread.ThreadPoolBudget.check(ThreadPoolBudget.java:149)
~[?:?]

at
org.eclipse.jetty.util.thread.ThreadPoolBudget.leaseTo(ThreadPoolBudget.java:130)
~[?:?]

at
org.eclipse.jetty.util.thread.ThreadPoolBudget.leaseFrom(ThreadPoolBudget.java:175)
~[?:?]

at
org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:278)
~[?:?]

at
org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:81)
~[?:?]

at
org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:235)
~[?:?]

at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
~[?:?]

at org.eclipse.jetty.server.Server.doStart(Server.java:398) ~[?:?]

at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
~[?:?]

at
org.apache.camel.component.websocket.WebsocketComponent.connect(WebsocketComponent.java:202)
~[?:?]

at
org.apache.camel.component.websocket.WebsocketEndpoint.connect(WebsocketEndpoint.java:123)
~[?:?]

at
org.apache.camel.component.websocket.WebsocketProducer.doStart(WebsocketProducer.java:84)
~[?:?]

at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
~[68:org.apache.camel.camel-core:2.23.0]

at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DeferServiceStartupListener.onCamelContextStarted(DeferServiceStartupListener.java:49)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3867)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3646)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3489)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3248)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3244)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3267)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3244)
~[68:org.apache.camel.camel-core:2.23.0]

at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3160)
~[68:org.apache.camel.camel-core:2.23.0]

at
org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:243)
~[66:org.apache.camel.camel-blueprint:2.23.0]

at
org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283)
~[66:org.apache.camel.camel-blueprint:2.23.0]

at
org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:177)
[66:org.apache.camel.camel-blueprint:2.23.0]

at
org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:190)
[47:org.apache.aries.blueprint.core:1.9.0]

at
org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:188)
[47:org.apache.aries.blueprint.core:1.9.0]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
[?:?]

at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
[?:?]

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[?:?]

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[?:?]

at java.lang.Thread.run(Thread.java:748) [?:?]

Caused by: java.lang.IllegalStateException: Insufficient configured
threads: required=3 < max=3 for
QueuedThreadPool[CamelJettyWebSocketServer]@2a618a47{STARTED,1<=1<=3,i=1,q=0}[ReservedThreadExecutor@485685c4
{s=0/1,p=0}]

at
org.eclipse.jetty.util.thread.ThreadPoolBudget.check(ThreadPoolBudget.java:149)
~[?:?]

at
org.eclipse.jetty.util.thread.ThreadPoolBudget.leaseTo(ThreadPoolBudget.java:130)
~[?:?]

at
org.eclipse.jetty.util.thread.ThreadPoolBudget.leaseFrom(ThreadPoolBudget.java:175)
~[?:?]

at org.eclipse.jetty.io.SelectorManager.doStart(SelectorManager.java:251)
~[?:?]

at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
~[?:?]

at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
~[?:?]

at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
~[?:?]

at
org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:279)
~[?:?]

at
org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:81)
~[?:?]

at
org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:235)
~[?:?]

at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
~[?:?]

at org.eclipse.jetty.server.Server.doStart(Server.java:398) ~[?:?]

... 31 more


On Thu, Dec 13, 2018, 2:45 AM Claus Ibsen <claus.ibsen@xxxxxxxxx> wrote:

> Hi
>
> You can configure them on the component level, see the table in the docs
>
> https://github.com/apache/camel/blob/master/components/camel-websocket/src/main/docs/websocket-component.adoc
>
> So you can define a <bean id="websocket"
> class="....WebSocketComponent"> where you setup these options
> On Thu, Dec 13, 2018 at 2:28 AM Bradford Fisher
> <bradford@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > I am having trouble determining where or how to configure the
> > camel-websocket maxThreads settings.
> >
> > I'm running Karaf 4.2.1 and have installed features camel-blueprint and
> > camel-websocket.
> >
> > I'm attempting to create a new websocket endpoint with the following
> > blueprint:
> >
> > <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";>
> >     <camelContext xmlns="http://camel.apache.org/schema/blueprint";>
> >         <route>
> >             <from uri="websocket://0.0.0.0:8080/echo" />
> >             <to uri="websocket://0.0.0.0:8080/echo" />
> >         </route>
> >     </camelContext>
> > </blueprint>
> >
> >
> > It seems that the initial value of (1 + 2 * cores === 3) on a single core
> > virtual machine is too low to start this single endpoint.
> >
> > Does anyone know how to increase the maxThreads count?
> >
> > Thanks in advance!
> >
> > - Brad
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>