camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Bourke (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-2394) Renamer failing to rename 'From' File when using multiple endpoints via Multicast
Date Thu, 28 Jan 2010 15:33:33 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-2394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57217#action_57217
] 

Andy Bourke commented on CAMEL-2394:
------------------------------------

Hi Claus,

Firstly, I still have not managed to work around or solve the problem - getting a bit desperate
now...

I believe that I know where the problem is occurring:

In Pipline.process there is a call to: ExchangeHelper.copyResults(exchange, nextExchange),
where 'exchange' is the original Exchange.

This call replaces the 'in' object in 'exchange' with the one in 'nextExchange'. As 'nextExchange'
has no headers (they are not copied when nextExchange is created) 'exchange' has no headers
and the 'GenericFileRenameProcessStrategy' tries to use 'CamelFileParent'  and 'CamelFileNameOnly'
(or 'CamelFileName') to construct the rename filename. Therefore it tries to rename the original
file to .\camel.

Does this make sense to you?

> Renamer failing to rename 'From' File when using multiple endpoints via Multicast
> ---------------------------------------------------------------------------------
>
>                 Key: CAMEL-2394
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2394
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.1.0
>         Environment: Windows Vista Business Service Pack 2, 32-bit
>            Reporter: Andy Bourke
>
> [Original Issue at Nabble|http://old.nabble.com/Renamer-failing-to-rename-%27From%27-File-when-using-multiple-endpoints-via-Multicast-td27272407s22882.html]
> I have a route that looks for a file in a directory => unmarshals the file using <CSV>
=> transforms the output from the unmarshal (which is List<List<String>>) to
a List of data objects => passes the List of data objects to a processor which does the
intelligent mapping of the input data to the output which is a List of Objects => passes
the List of Objects to a <multicast> pipeline who's endpoints traverse the List of Objects
and extract the data, that they are interested in, formatting the output in to a List of Map
objects so that the <CSV> marshaller can marshal to a named file. 
> This is the route: 
> {code}
>         <route id="iq"> 
>             <from uri="file:/data/iq/inbound/"/> 
>             <unmarshal> 
>                 <csv id="pipeCsvDataFormat"/> 
>             </unmarshal> 
>             <bean ref="iqTransform" method="doTransform"/> 
>             <to uri="bean:iqProcessor?method=process"/> 
>             <multicast parallelProcessing="true"> 
>                 <pipeline> 
>                     <to uri="bean:formatOutput?method=formatHeader"/> 
>                     <marshal> 
>                         <csv /> 
>                     </marshal> 
>                     <to uri="file:/data/iq/outbound/?fileName=Txn_Header.txt"/>

>                 </pipeline> 
>                 <pipeline> 
>                     <to uri="bean:formatOutput?method=formatLineHeader"/> 
>                     <marshal> 
>                         <csv /> 
>                     </marshal> 
>                     <to uri="file:/data/iq/outbound/?fileName=Line_Header.txt"/>

>                 </pipeline> 
>             </multicast> 
>         </route> 
> {code}
> As expected, I get a correctly formatted file named Txn_Header.txt and a file named Line_Header.txt
in the /outbound directory. So the routing seems to have worked fine. 
> The problem is that the original file does not get renamed in to the .camel subdirectory
and so the file gets processed again and again. 
> If I remove the second endpoint in the multicast so that only the Txn_Header.txt file
is produced then the original file does get renamed and the route ends successfully. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message