Re: Split: how to leave message untouched?

2012-06-20 Thread PJ Walstroem
thank you, that worked perfectly.

--
View this message in context: 
http://camel.465427.n5.nabble.com/Split-how-to-leave-message-untouched-tp5714734p5714749.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Split: how to leave message untouched?

2012-06-20 Thread Claus Ibsen
Hi

Easier to crete a route for the splitter
And then have another route that does the filter. And use the direct
endpoint to call the other route.

from X
  filter bla
to splitme
  end
common stuff here

from direct:splitme
   split tokenize xml


On Wed, Jun 20, 2012 at 2:55 PM, PJ Walstroem  wrote:
> if the filter() Predicate returns false, I assume the processing stops there?
> I would like to go beyond the split() and carry on with the .convertBodyTo()
> etc. in case the filter() returns false.
>
> I tried something like
> from(incomingQueue)
> .choice()
> .when().xpath(UPDATE_XPATH)
> .split().tokenizeXML("update", "dbStream")
> .end()
> .convertBodyTo()
> 
>
> and even
> from(incomingQueue)
> .split(xpath(UPDATE_XPATH).tokenizeXML("update", "dbStream"))
> .end()
> .convertBodyTo()
>
> but they are not correct. Don't know how to solve this
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Split-how-to-leave-message-untouched-tp5714734p5714743.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Re: Split: how to leave message untouched?

2012-06-20 Thread PJ Walstroem
if the filter() Predicate returns false, I assume the processing stops there?
I would like to go beyond the split() and carry on with the .convertBodyTo()
etc. in case the filter() returns false.

I tried something like
from(incomingQueue)
.choice()
.when().xpath(UPDATE_XPATH)
.split().tokenizeXML("update", "dbStream")
.end()
.convertBodyTo()


and even
from(incomingQueue)
.split(xpath(UPDATE_XPATH).tokenizeXML("update", "dbStream"))
.end()
.convertBodyTo()

but they are not correct. Don't know how to solve this



--
View this message in context: 
http://camel.465427.n5.nabble.com/Split-how-to-leave-message-untouched-tp5714734p5714743.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Split: how to leave message untouched?

2012-06-20 Thread Claus Ibsen
On Wed, Jun 20, 2012 at 1:02 PM, PJ Walstroem  wrote:
> hello,
> I split messages using
>
> from(incomingQueue)
> .startupOrder(1)
> *.split().tokenizeXML("update", "dbStream")*
> .convertBodyTo(Document.class)
> .choice()
> .when().xpath(SUBSCRIPTION_XPATH)
> .to(AGGREGATE_MESSAGES)
> .otherwise()
> .to(PRODUCERS)
> .end();
>
> however, when the XML does not contain neither  nor , the
> routing just seems to stop. Is there a way to let messages through that are
> not applied by the split?
>

You can use the filter EIP to filter out message that are not 
XML messages.
The tokenizeXML requires the message structure to be XML and have a
root tag named  which contains a list of child tags named
.

> According to  http://camel.apache.org/splitter.html
> http://camel.apache.org/splitter.html , "The Splitter will by default return
> the original input message", but I can not see that happen in this case.
>
> Using Camel 2.9.2
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Split-how-to-leave-message-untouched-tp5714734.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen


Split: how to leave message untouched?

2012-06-20 Thread PJ Walstroem
hello,
I split messages using 

from(incomingQueue)
.startupOrder(1)
*.split().tokenizeXML("update", "dbStream")*
.convertBodyTo(Document.class)
.choice()
.when().xpath(SUBSCRIPTION_XPATH)
.to(AGGREGATE_MESSAGES)
.otherwise()
.to(PRODUCERS)
.end();

however, when the XML does not contain neither  nor , the
routing just seems to stop. Is there a way to let messages through that are
not applied by the split?

According to  http://camel.apache.org/splitter.html
http://camel.apache.org/splitter.html , "The Splitter will by default return
the original input message", but I can not see that happen in this case.

Using Camel 2.9.2

--
View this message in context: 
http://camel.465427.n5.nabble.com/Split-how-to-leave-message-untouched-tp5714734.html
Sent from the Camel - Users mailing list archive at Nabble.com.