camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hilde <hilde.sch...@yahoo.de>
Subject Re: Component file: move and moveFailed
Date Mon, 07 May 2012 07:07:21 GMT
Hello Claus!

Here comes the full camel route:

<camel:endpoint id="fileInEndpoint"
		
uri="file://[[configDir]]?filter=#filter&amp;move=.done/${file:name.noext}-${date:now:yyyy_MM_dd_HH_mm_ss}.${file:ext}&amp;moveFailed=.error/${file:name.noext}-${date:now:yyyy_MM_dd_HH_mm_ss}.${file:ext}&amp;delay=10000"
/>

<camel:onException>
    <camel:exception>java.lang.IllegalArgumentException</camel:exception>
    <camel:exception>javax.validation.ValidationException</camel:exception>
    <handled>
	<constant>false</constant>
    </handled>
    <camel:transform>
	<camel:simple>Error reported - cannot proceed:
              ${exception.message}
              ${exception.stacktrace}
	</camel:simple>
    </camel:transform>
    <camel:to
uri="log:importlog?level=ERROR&amp;showAll=true&amp;multiline=true" />
    <camel:setHeader headerName="Subject">
	<camel:simple>Failure while reading configuration file</camel:simple>
    </camel:setHeader>
    <camel:setHeader headerName="From">
	<camel:constant>[[fromMail]]</camel:constant>
    </camel:setHeader>
    <camel:setHeader headerName="to">
	<camel:simple>${ref:defaultMail.defaultContact}</camel:simple>
    </camel:setHeader>
    <camel:bean ref="mailProcess" />
	<camel:setBody>
    <camel:simple>Failure while reading configuration file:
              ${exception.message}</camel:simple>
    </camel:setBody>
    <camel:setHeader headerName="success">
	<camel:constant>false</camel:constant>
    </camel:setHeader>
    <camel:to uri="seda:logger" />
    <camel:to ref="failMail" />
</camel:onException>


<camel:route id="readConfig">
  <camel:from ref="fileInEndpoint" />
  <camel:onCompletion>
	<camel:bean ref="reset" method="resetRepo" />
  </camel:onCompletion>
  <camel:transacted ref="PROPAGATION_REQUIRED" />
  <camel:to uri="sql:update name set readyForChange =
1?dataSourceRef=dataSource" />
  <camel:setHeader headerName="operationName">
    <camel:simple>Import</camel:simple> 
  </camel:setHeader>
  <camel:unmarshal ref="bindyDataformat" />			
  <camel:split stopOnException="true" strategyRef="importProtokollStrategy">
    <camel:simple>${body}</camel:simple>
      <camel:idempotentConsumer messageIdRepositoryRef="myRepo" 
           eager="true" skipDuplicate="false">
      <camel:simple>${body.values()[0].brandId}</camel:simple>
      <camel:filter>
	<camel:property>CamelDuplicateMessage</camel:property>
	<camel:throwException ref="validationException" />
	<camel:stop />
      </camel:filter>
      <camel:bean ref="convertToEntities" />
      <camel:to uri="jpa://org.cameltest.entity.Name?flushOnSend=false" />
      <camel:bean ref="addToRunninDataRelease" />
    </camel:idempotentConsumer>
  </camel:split>
  <camel:setHeader headerName="success">
    <camel:constant>true</camel:constant>
  </camel:setHeader>
  <camel:process ref="inactivateNames" />
  <camel:bean ref="commentAggregator" />
  <camel:to uri="seda:logger" />
</camel:route>



--
View this message in context: http://camel.465427.n5.nabble.com/Component-file-move-and-moveFailed-tp5685631p5690355.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message