Search code examples
javarestapache-camelrestlet

How to increase or configure maxThreads in apache came -restlet


I am working on performance testing of apache camel restlet . Now I came to know it has limit of 10 threads.

I found that we have maxThreads on Component level of Restlet .

I also tried camel-restlet-maxthreads-component-option, but didn't work for me.

I am using

    <bean id="restlet" class="org.apache.camel.component.restlet.RestletComponent">
        <property name="maxThreads" value="50"/>
    </bean>

    <restConfiguration bindingMode="off" component="restlet" scheme="http" port="8080" enableCORS="true" >

            <endpointProperty key="sslContextParameters" value="#restSSLContext"/>
            <corsHeaders key="Access-Control-Allow-Origin" value="*"/>
            <corsHeaders key="Access-Control-Allow-Headers" value="Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers"/>
            <corsHeaders key="Access-Control-Allow-Methods" value="GET,PUT,POST,DELETE,OPTIONS"/>

        </restConfiguration>

Using : Camel Version: 2.18.2

Please help me on how to configure maxThreads,minThreads..etc


Solution

  • Guys I found the answer for this maxThreads configuration for RESTLET in camel.

    you can see below code for RESTLET configuration in Camel.

        <bean id="restletComponent" class="org.restlet.Component" />
    
        <bean id="restlet" class="org.apache.camel.component.restlet.RestletComponent">
            <constructor-arg index="0">
                <ref bean="restletComponent" />
            </constructor-arg>
            <property name="maxThreads" value="20" />
            <property name="minThreads" value="1" />
            <property name="threadMaxIdleTimeMs" value="60000" />
        </bean> 
    

    It's perfectly working for me.

    @Claus, I think we need to update this in Camel-Restlet documentation for people like me .

    The one which is in Camel-restlet page didn't work for me.