At the end of my java bean process I set my exchange body to :
exchange.getIn().setBody(files, ArrayList.class);
and just after use this part of code call my splitter processor bean :
@Handler
public List<Message> splitMessage(@Header(value = Exchange.FILE_NAME)
String header, @Body List<File> bodies) {
// we can leverage the Parameter Binding Annotations
// http://camel.apache.org/parameter-binding-annotations.html
// to access the message header and body at same time,
// then create the message that we want, splitter will
// take care rest of them.
// *NOTE* this feature requires Camel version >= 1.6.1
List<Message> answer = new ArrayList<Message>();
if (bodies != null && !bodies.isEmpty()) {
for (File body : bodies) {
if (body.exists()) {
DefaultMessage message = new DefaultMessage();
message.setBody(body, File.class);
message.setHeader(Exchange.FILE_NAME, body.getName());
answer.add(message);
}
}
}
return answer;
}
and it works fine.
When the split process is finished there is my <camel:to
ref="EP_OUT_DATALAB_ACTE_TRANSFERT" />
But between my split folder and outgoing folder referenced by the endpoint
EP_OUT_DATALAB_ACTE_TRANSFERT, the splitted files have disappeared.
--
View this message in context:
http://camel.465427.n5.nabble.com/files-disappeared-between-2-routes-tp5732950p5732964.html
Sent from the Camel - Users mailing list archive at Nabble.com.