1 Reply Latest reply on Feb 14, 2017 4:18 AM by davsclaus

    Camel body getting lost when you enable DEBUG in KARAF 2.4.0.redhat-621159 (jboss-fuse-6.2.1.redhat-159)



      I have seen a strange issue today in jboss fuse - When you set the log to DEBUG (log:set DEBUG) in karaf container and run a camel application the body is getting lost (returning empty). certainly i am getting this issue in all the previous versions of fuse as well.


      Unable to figure out what issue may be  (suspecting a tracer interceptors when you enable debug on root level). - All working OK if you set the log level to INFO.


      Here is my sample code.


      explanation of code: I have a rest service exposed to outside. when the service is being called i am checking few things to determine which service provider to be called.

      from direct VM and calling the third party service. thats it and it is very simple code. (exception handling is being covered and not been displayed here)


      Can anyone shed their views about the issue please though i've been using redhat Jboss Fuse for a quite long time and unable to figure out the issue ?


      <camelContext trace="false" id="my-app-camel-context" streamCache="true"

          useMDCLogging="true" xmlns="http://camel.apache.org/schema/spring"




          <!-- disabled the cache spool to disk as we wanted the whole payload to be in memory as payload is huge -->

               <property key="CamelCachedOutputStreamThreshold" value="-1"/>



           <propertyPlaceholder id="camelProps" location="ref:props"/>


           <route id="my.app.gateway">

               <from uri="cxfrs:bean:myAppGateway?bindingStyle=SimpleConsumer"/>




                       <simple>${header.myAppPayloadType} == null</simple>

                       <setHeader headerName="myAppPayloadType">

                           <xpath resultType="java.lang.String">/app:appRequest/myAppPayloadType/text()</xpath>


                       <setHeader headerName="myAppContextName">

                           <xpath resultType="java.lang.String">/app:appRequest/myAppContextName/text()</xpath>








               <log loggingLevel="INFO" message="Received app request for: ${header.myAppPayloadType}"/>

               <convertBodyTo type="java.lang.String"/>


               <setHeader headerName="Content-Length">








               <removeHeaders pattern="*"/>


               <convertBodyTo type="java.io.InputStream"/>




           <route id="app.service.provider.route">

               <from uri="direct-vm:app.provider.XYZ"/>



                       <simple>${header.myAppContextName} != null</simple>


                           <simple>{{THIRDPARTY_WEBSERVICE}}?bridgeEndpoint=true</simple> <!-- response message from third party getting lost when DEBUG enabled in karaf but response displaying in logs-->