I have multiple call to end points configured within the same camel route. I am using camel ahc component. This works fine under the normal scenario. We are facing issues during the performance testing.
<camel:route>
<camel:from id="_MessageFlow_20_1422954968407" uri="abcd:XXX/ZEMPSRV:Employees"/>
<camel:choice id="_ExclusiveGateway_8_1422954968423">
<camel:when>
<camel:simple>${header.Method} == 'READ'</camel:simple>
<camel:setHeader id="READ_Header_1" headerName="RelativeUri">
<camel:bean id="_CallActivity_69_1422954968443" ref="odatarestprocessor" method="process"/>
<camel:setHeader id="READ_Header_2" headerName="scriptFile">
<camel:setHeader id="READ_Header_3" headerName="functionName">
<camel:setHeader id="READ_Header_4" headerName="scriptFileType">
<camel:bean id="READ_scriptprocessor_pre" ref="scriptprocessor" method="process"/>
<camel:bean id="_ServiceTask_14_1422954968508" ref="odataDestinationProcessor" method="process"/>
<camel:to uri="ipahc:http://dummy?synchronous=true"/>
<camel:setHeader id="READ_Header_5" headerName="RestContentType">
<camel:setBody id="_CallActivity_71_1422954968510">
<camel:setHeader id="READ_Header_6" headerName="scriptFile">
<camel:setHeader id="READ_Header_7" headerName="functionName">
<camel:setHeader id="READ_Header_8" headerName="scriptFileType">
<camel:bean id="READ_scriptprocessor_post" ref="scriptprocessor" method="process"/>
<camel:bean id="_CallActivity_73_1422954968577" ref="restHashMapProcessor" method="process"/>
</camel:when>
<camel:when>
<camel:simple>${header.Method} == 'FEED'</camel:simple>
<camel:setHeader id="FEED_Header_1" headerName="RelativeUri">
<camel:setHeader id="FEED_Header_2" headerName="scriptFile">
<camel:setHeader id="FEED_Header_3" headerName="functionName">
<camel:setHeader id="FEED_Header_4" headerName="scriptFileType">
<camel:bean id="FEED_scriptprocessor_pre" ref="scriptprocessor" method="process"/>
<camel:bean id="_ServiceTask_15_1422954968675" ref="odataDestinationProcessor" method="process"/>
<camel:to uri="ipahc:http://dummy?synchronous=true "/>
<camel:setHeader id="FEED_Header_5" headerName="RestContentType">
<camel:setBody id="_CallActivity_76_1422954968677">
<camel:setHeader id="FEED_Header_6" headerName="scriptFile">
<camel:setHeader id="FEED_Header_7" headerName="functionName">
<camel:setHeader id="FEED_Header_8" headerName="scriptFileType">
<camel:bean id="FEED_scriptprocessor_post" ref="scriptprocessor" method="process"/>
<camel:bean id="_CallActivity_78_1422954968744" ref="restHashMapProcessor" method="process"/>
</camel:when>
<camel:otherwise/>
</camel:choice>
</camel:route>
The issue is these two calls are getting mixed. Could you please suggest how to avoid this. After we are done with the call to READ, in post processing the value of header Method is FEED. It seems these two calls are getting mixed. Could you please suggest how this can be fixed.
Thanks, Rakesh