java - Apache Camel deleteAfterRead does not work -
so want fetch file amazon s3 bucket , delete (use s3 queue). huge problem apache camel receiving same messages , not try delete them.
here have route from("aws-s3://bucket?amazons3client=#s3client&deleteafterread=true")
flag.
the whole route
from("aws-s3://bucket?amazons3client=#s3client&deleteafterread=true") .to("seda:queue");
i tried add processor reads inputstreams (though read , delete)
.process(new processor() { @override public void process(exchange exchange) throws exception { inputstream stream = (inputstream) exchange.getin().getbody(); exchange.getin().setbody(ioutils.tostring(stream)); } })
also have camel context file. here is.
<bean id="awsregion" class="org.springframework.beans.factory.config.methodinvokingfactorybean"> <property name="targetclass" value="com.amazonaws.regions.regionutils"/> <property name="targetmethod" value="getregion"/> <property name="arguments"> <list> <value>us-west-1</value> </list> </property> </bean> <bean name="s3client" class="com.amazonaws.services.s3.amazons3client"> <constructor-arg> <bean class="com.amazonaws.auth.basicawscredentials"> <constructor-arg value="${access.key}"/> <constructor-arg value="${secret.key}"/> </bean> </constructor-arg> </bean> <!-- enable spring @component scan --> <context:component-scan base-package="com.titan.router"/> <camelcontext id="camelcontext" xmlns="http://camel.apache.org/schema/spring"> <!-- , let camel use @component scanned route builders --> <contextscan/> <consumertemplate id="consumer"/> <template id="producer"/> <threadpoolprofile id="titanrouterprofile" poolsize="20" maxpoolsize="50" maxqueuesize="-1"/> </camelcontext>
upd1 funny thing if remove second queue , pass object end object removed. from("queue?amazons3client=#s3client").process(...).end();
checked s3 storage , didn't find files.
Comments
Post a Comment