You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Michele <mi...@finconsgroup.com> on 2015/12/06 11:48:14 UTC

Camel-cache usaed in Enricher Route

Hi everyone,

this is my scenario:

1. Receiving a file from FTP Component
2. Set it in header a correct absolute xml file path depending on file name
to parse a file
3. Enrich message with java object marshalled on xml only if the
configuration is not present in cache
3. Processing and store in MQ.

This is my configuration that doesn't work :( :

<route>
  <from uri="ftp:..."/>
  <setHeader headerName="TranscodingRulesXmlFile">
	<simple>..../transcode-rules.xml</simple>
  </setHeader>
 <enrich uri="direct:ConfigurationCached"
strategyRef="MergeExchengeAggregationStrategy" />
<process ..../> 
 .....
</route>

<route id="CachingConfiguration_Route" >
     <from uri="direct:ConfigurationCached" />
	<setHeader
headerName="CamelCacheOperation"><constant>GET</constant></setHeader>
	<setHeader
headerName="CamelCacheKey"><simple>${in.header.TranscodingRulesXmlFile}</simple></setHeader>
			<log message="Check key $simple{in.header.CamelCacheKey}." />				
			<to uri="cache:TranscodeRulesConfigurationCache" />
			<choice>
				<when>
					<simple>${in.header.CamelCacheElementWasFound} == null</simple>
					<log message="Configuration non presente in cache." />
					<marshal ref="myJaxb"/>
					<setHeader
headerName="CamelCacheOperation"><constant>ADD</constant></setHeader>
					<setHeader
headerName="CamelCacheKey"><simple>${in.header.TranscodingRulesXmlFile}</simple></setHeader>
					<to uri="cache:TranscodeRulesConfigurationCache" />
				</when>			
			</choice>
		</route>

MergeExchengeAggregationStrategy used to aggregate file content with
transcode rules java object.

Where is the error? Have you suggestions?

Thanks in advance
Kind Regards

Michele



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-cache-usaed-in-Enricher-Route-tp5774747.html
Sent from the Camel - Users mailing list archive at Nabble.com.