0

We have camel based application. Camel Context file is

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/spring"
       xsi:schemaLocation="
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
         http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

<camelContext id="CamelContext" xmlns="http://camel.apache.org/schema/spring" autoStartup="true">
    <properties>
        <property key="http.keepAlive" value="true"/>
    </properties>

    <threadPoolProfile id="profile"
                       defaultProfile="true"
                       keepAliveTime="30"
                       maxPoolSize="1500"
                       rejectedPolicy="DiscardOldest"
                       poolSize="1000"></threadPoolProfile>
    <onException>
        <exception>com.fasterxml.jackson.databind.exc.InvalidFormatException</exception>
        <redeliveryPolicy maximumRedeliveries="0"/>
        <handled>
            <constant>true</constant>
        </handled>
        <to uri="bean:jacksonMappingExceptionHandler" />
        <process ref="httpResponseTransformer"/>
    </onException>

<restConfiguration component="jetty" bindingMode="json" contextPath="/app" port="9886" apiContextPath="/v1/api-doc" enableCORS="true">
    <dataFormatProperty key="include" value="NON_NULL"></dataFormatProperty>
    <apiProperty key="api.title" value="Application Service"/>
    <apiProperty key="api.version" value="1.0.0"/>
    <apiProperty key="cors" value="true"/>

</restConfiguration>

<!-- defines the rest services using the context-path /api -->

<rest path="/v1/abc" consumes="application/json" produces="application/json">

    <description>Abc</description>

    <post type="com.Request" outType="com.Response">
        <to uri="direct-vm:JettyHttp"/>
    </post>

</rest>

    <rest path="/api/status"   produces="application/json">
        <description>Application Status</description>
        <get outType="com.StatusResponse">
            <description>Get Status</description>
            <to uri="direct-vm:status"/>
        </get>
    </rest>

</camelContext>

</beans>

Some of the configuration are getting loaded from DB. Due to security, I won't be able to post full code over here.

We have written automation scripts to check validations on request. In single specifications, we have more then 200 scenarios.

Issue: After certain amount of http request to uri, applications stops responding. I have added keepAlive property, as well as threadpool configuration in CamelContext.

However none this is working. Kindly suggest me some work around.

Thanks in Advance.

Jay Patel
  • 523
  • 2
  • 15
  • 26
  • The given information is probably not enough to determine the actual cause of your issue. As always, have you tried using a profiler to see which thread is blocking further responses. `After certain amount of http requests` is also very vague. One thing I noted though is the usage of [direct-vm](http://camel.apache.org/direct-vm.html). Do you spawn multiple camel-based applications within the same VM and communicate via these channels with other applications? At least for processing HTTP requests I don't really see a benefit of those compared to plain `direct` routes actually. – Roman Vottner Dec 07 '18 at 14:57
  • @RomanVottner: To be precise It's 97 connections. it's connecting to other applications with it. we have 3 applications to which we are connecting and fetching the response one by one. It's very old application. I have to fix and execute all the automation scripts to make the report green. – Jay Patel Dec 07 '18 at 15:01
  • If there are multiple applications sharing the same memory and you can drill down the problem to 97 connections maybe the applications run out of enough memory as to many requests (and therefore open connections) are kept in memory and the JVM runs its GC way to often and at some point performs a stopp-the-world collection wich results in notable unresponsive systems – Roman Vottner Dec 07 '18 at 15:08

0 Answers0