Hi,
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
end.
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"
class="org.apache.camel.impl.DefaultStreamCachingStrategy">
<property name="spoolDirectory"
value="${tempSpoolDirectory}"></property>
<property name="spoolThreshold" value="131072"></property>
<property name="spoolUsedHeapMemoryThreshold">
<value type="java.lang.Integer">30</value>
</property>
<property name="removeSpoolDirectoryWhenStopping"
value="true"></property>
</bean>
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:
DefaultStreamCachingStrategy[spoolDirectory=/home/testing/tmp,
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:
bridgePropertyPlaceholder
[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
enabled
[main] 2015-12-14 06:47:22 INFO DefaultTypeConverter:50 - Loaded 206 type
converters
[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
performance.
[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.
Thanks,
Kalyan
--
View this message in context:
http://camel.465427.n5.nabble.com/Camel-Stream-caching-unable-to-capture-the-entire-stream-tp5775055.html
Sent from the Camel - Users mailing list archive at Nabble.com.