The splitter need to store some state on each sub exchange and that information is not serializable.
The transferExchange option on JMS is limited as JMS spec only allows X number of types to be send over JMS.
Whats your use case to use transferExchange ?
I have a series of camel routes.
I try to explain.
route 1 : Poll a directory, make some validation on the file found and move file (one or more) to a working directory (specific for each file which start the process). I put the specific working directory in a property of the exchange and send to a queue with transferExchange to keep the property of the exchange.
route 2 : read from the previous queue, split with custom pojo (unzip and create a list of file unzipped). On each splitted element, i make some job (create command message for an external application) and send to a queue with transferExchange to keep the property of the original exchange and the property of the split process (camelSplitComplete).
route 3 : read from the previous queue, process the command message (the external application create some files in the working directory and respond only with the master filename created) and aggregate the result based on camelSplitComplete.
Do you have a better solution ?
Thanks in advance
Just put information as headers and do not use transferExchange
If i understand correctly, i put my properties in the headers of the message.
OK i try but where the split put the properties ? In the doc, i see in the exchange. How i can retrieve the property camelSplitComplete ?
thanks in advance
Before you send to the AMQ you put whatever you want in headers. So if there are details from the Exchange properties, then you just grab those and put in as headers.
For example using a Processor
OK but I have one more question. It's not easy for me to know the best destination (exchange property or message header) for some properties. Do you have maybe a documentation which explain the aim of the two element.
If i read the doc, i see sometimes the properties are set in the message headers like file component, sometime in exchange properties like split eip. Why we put the properties in different location ? How you decide the best position ? Have you some idea to realize the best choice ?
In my case, i have three routes. I have three exchange (one by route). Is it correct ?
Thanks in advance
properties are meta-data that eg EIP and whatnot put details in. And properties are kept on the Exchange during the lifecycle.
headers is part of the message. eg like HTTP headers, SOAP headers and whatnot.
Thanks a lot for your time
I have created a ticket to also look into fixing the transferExchange=true working out of the box with the splitter as we can check for that piece of logic that are not serializable from the splitter