camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sriramch <>
Subject File endpoint and GzipDataFormat question
Date Wed, 24 Jun 2009 00:27:25 GMT

I am using the latest camel 2.0-m2 release. I have a list of gzipped file in
a step within a route. I need to extract the contents from the gzipped
location and then based on 1 of 3 types of tokens in the filename, I need to
pass the extracted filename to 3 different beans. My route looks like the

 	<camel:from uri="direct:getGippedFiles" />
	<camel:bean ref="gzipDownloader" method="doDownload"/>
	<!-- This produces an ArrayList<String> for the filePaths -->
					<camel:when >
						<camel:simple>body contains 'Token1'</camel:simple>
						<camel:to uri="file://filename=${body}" />
						<camel:unmarshal ref="gunzip"/>
						<camel:bean ref="bean1" method="myMethod"/>
					<camel:when >
						<camel:simple>body contains 'Token2'</camel:simple>
						<camel:to uri="file://filename=${body}" />
						<camel:unmarshal ref="gunzip"/>
						<camel:bean ref="bean2" method="myMethod"/>

I have defined the bean gunzip as 
<bean id="gunzip" class="org.apache.camel.model.dataformat.GzipDataFormat"/>

However I get the following exception. 
ERROR [17:24:20,432] - org.apache.camel.processor.Logger.log(207) | Failed
delivery for exchangeId: ID-CM-Latitude-E55-50750-1245802622632-0-1. On
delivery attempt: 0 caught: Not in GZIP format Not in GZIP format
	at org.apache.camel.impl.GzipDataFormat.unmarshal(

The problem seems to be that the GzipDataFormat:unmarshal method expects an
inputstream and not a string filename. What do I need to change in my route
to have the file opened as a stream for the GzipDataForm:unmarshal method.
Is what I am trying to do a good usecase for the file endpoint and gzip?
This is simple enough to do with java code, but I am trying to avoid writing
any code if I can help.

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

View raw message