Just please ignore the mail below and save me the embarassment. This will teach me not to send emails at 3:00am in the morning.
Thanks, Tarun On Thu, Dec 9, 2010 at 3:07 AM, Tarun Ramakrishna <lenk...@gmail.com> wrote: > Hi all, > > I have a puzzler and I thought I would throw it to the list before > going into camel debugging. > > I have a custom mapping processor that given an Exchange, takes its > payload, split it to several payloads, creates an array list of byte[] > and sets them back into the IN message of the exchange. In the next > step, I use the Camel splitter to send Message 0 of the splitter and > Message 1 of the splitter to different components. Here is the rub - > if these components are file components, nothing happens! When I > replace them by components other than the file components, say: mock > endpoints or logging endpoints, I clearly see the exchanges being > produced! > > SNIPPET: > //In the below the 'pim' component is my custom component that split > the message into an arraylist of byte[] and sets it as the IN message > body as recommended by FAQ Entry: How do I write a custom Processor > which sends multiple messages? > > from("direct:start") > .to("pim:SplitMapping01.zip?cardinality=1_N") > .split(simple("${in.body}")) > .choice() > .when(header("CamelSplitIndex").isEqualTo(0)) > .to("file://tmp/tringo") > .to("log:MESSAGE1?level=ERROR") > .when(header("CamelSplitIndex").isEqualTo(1)) > .to("file://tmp/bingo") > .to("log:MESSAGE2?level=ERROR"); > > The log statements issued by MESSAGE1 and MESSAGE2 are indeed seen, > but no files are produced in either of 'tringo' or 'bingo' > directories!. Maybe, I am making a stupid mistake somewhere but I > can't see it ? > > Example Output (The 2 log statements get issued shown below) > > Dec 9, 2010 3:03:33 AM org.apache.camel.processor.Logger process > SEVERE: Exchange[ExchangePattern:InOnly, BodyType:byte[], Body:<?xml > version="1.0" encoding="UTF-8"?> > <ns1:Order xmlns:ns1="http://mydemo.com > "><Customer><CustomerID>0815</CustomerID><CompanyName>AuntEmmaStore</CompanyName></Customer><OrderItem><Product><ProductID>01-12345-A</ProductID><Description>Potato > 1 > kg</Description><Price>1.50</Price></Product><Quantity>100</Quantity></OrderItem><OrderItem><Product><ProductID>01-12346-A</ProductID><Description>Apple > 1 > kg</Description><Price>1.99</Price></Product><Quantity>80</Quantity></OrderItem></ns1:Order>] > > Dec 9, 2010 3:03:33 AM org.apache.camel.processor.Logger process > SEVERE: Exchange[ExchangePattern:InOnly, BodyType:byte[], > Body:<ns1:MarketingItem > xmlns:ns1="http://mydemo.com > "><Customer><CustomerID>0815</CustomerID><CompanyName>AuntEmmaStore</CompanyName></Customer><ProductIDList><ProductID>01-12345-A</ProductID><ProductID>01-12346-A</ProductID><ProductID>00-12345-A</ProductID></ProductIDList></ns1:MarketingItem>] > > > All advice/help appreciated! > Thanks & Regards, > Tarun >