Hi,
I use camel routes for implementation of integration platform. My routes are defined in java DSL camel component and i use file binding.
I have the following case:
CamelRoute.java:
onException(Throwable.class)
.setHeader("PrefixFileName", "error")
.setProperty("PrefixFileName", "error");
from("switchyard://InboundService")
.throwException(new Exception());
Property used in file input binding:
moveFailed=/error/$${headers.PrefixFileName}.txt
After tests i noticed that the files was moved from source to the error directory properly, but error file name is incorrect. File with the following file name was created: '.txt'. It seems headers is empty so my question is how to use error file name composed by headers?
Similar code developed in camel without switchyard works fine. So maybe some additional activities are required to transfer headers from camel context (message composers and context mappers are not executed after raise error by camel code).
switchayrd: 2.0.1
eap: 6.4
apache camel: 2.15.1
It looks like a bug - on a normal route the context properties are carried back, but not on a fault route. Filed a JIRA to track:
[SWITCHYARD-2906] Context properties are not carried back on fault route - JBoss Issue Tracker