camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From glenn <>
Subject Re: Guaranteed file processing - JMS and file producer
Date Wed, 13 Apr 2016 12:41:27 GMT

I'm supplying a simplified route to assist. I didn't consider using the
persistent aggregation strategy here in that a single message is being
transformed into a single file - I hope that's clearer now with the example
route. The FileIdempotentRepository provides sufficient persistence needed
per my understanding.

The file component uri being used is actually to be determined but once the
files are placed in output folders there will be an external process to move
Without the idempotent repository and assuming the file name itself could be
idempotent I did consider allowing for the existing file to be updated but I
opted against this on basis that I cannot control when the subsequent
write/update will happen - it's possible the original file has already been
moved before the update. 
So have opted to prefer never to write the file twice (effectively removing
risk of duplicate response to an external system) and trade this off against
current risk that may not write any response.
In either scenario, as is, there would have to be mitigation to address and
it seems easier to detect and handle the latter, missed response scenario. 

I totally appreciate the probability of this is remote but I'm conscious
that I may be missing a simpler solution that would guarantee one file
output for every one message consumed that is based on use of the Camel file
component with local JMS transactions. That would avoiding any need to
implement mitigation measures or need to switch to use an XA file producer
that supports global transactions.

<route id="someRoute">
	<from uri="jms:ANAME.INV.RESP.Q" />

	<transacted />


	<idempotentConsumer messageIdRepositoryRef="consumerIdempotentRepository"
eager="true" completionEager="false" skipDuplicate="false">
			<to uri="direct:duplicateMessageDetected" />
			<stop />

<route id="duplicateMessageDetectedRoute">
	<from uri="direct:duplicateMessageDetected" />
	<log message="${id}:${file:name}: Duplicate message detected, ignoring
message \n" loggingLevel="WARN" />

<bean id="consumerIdempotentRepository"


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

View raw message