camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "calyan.bandi" <>
Subject Camel Stream caching unable to capture the entire stream
Date Mon, 14 Dec 2015 14:08:18 GMT

I have a camel route which invokes a webservice, and tries to processes the
response. I am using cxfrs component for the invocation. The response i am
receiving is very huge and hence most of the content is removed from the

To remedy this, i am using stream caching -
org.apache.camel.spi.StreamCachingStrategy. These options are not helping me
in the route as i still see that the response is not fully captured and the
end of the response is getting purged. Below are the settings i am using the
camel context and the streamCache is enabled per route. I have tried to set
the streamCache value per route and on the whole context, it didn't make any
difference. Hence i am setting this value per route.

<bean id="myResponseStreamStrategy"
		<property name="spoolDirectory" value="${tempSpoolDirectory}"></property>
		<property name="spoolThreshold" value="131072"></property>
		<property name="spoolUsedHeapMemoryThreshold">
			<value type="java.lang.Integer">30</value>
		<property name="removeSpoolDirectoryWhenStopping" value="true"></property>

And in the logs i can see the settings being applied as:
[main] 2015-12-14 06:47:22 INFO  AbstractCamelContextFactoryBean:892 - Using
custom StreamCachingStrategy:
spoolChiper=null, spoolThreshold=131072, spoolUsedHeapMemoryThreshold=30,
bufferSize=4096, anySpoolRules=false]
[main] 2015-12-14 06:47:22 INFO  CamelContextFactoryBean:273 - Bridging
Camel and Spring property placeholder configurer with id:
[main] 2015-12-14 06:47:22 INFO  SpringCamelContext:1637 - Apache Camel
2.13.2 (CamelContext: context) is starting
[main] 2015-12-14 06:47:22 INFO  ManagedManagementStrategy:187 - JMX is
[main] 2015-12-14 06:47:22 INFO  DefaultTypeConverter:50 - Loaded 206 type
[main] 2015-12-14 06:47:23 INFO  SpringCamelContext:1831 -
AllowUseOriginalMessage is enabled. If access to the original message is not
needed, then its recommended to turn this option off as it may improve
[main] 2015-12-14 06:47:23 INFO  DefaultStreamCachingStrategy:314 -
StreamCaching in use with spool directory: /home/testing/tmp and rules:
[Spool > 128K body size, Spool > 30% used of Max heap memory]

I ran a java utility seperately to capture the entire response with which i
captured the full JSON response and the size of the entire string is around
71172 bytes. 

Any pointers around this issue, kindly suggest.


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message