This content has been marked as final.
Show 1 reply
-
1. Re: Processor and Endpoint difference?
janstey Dec 11, 2008 9:38 PM (in response to anielson)Endpoints are typically places you get messages from or send messages to. Processors are used to manipulate/mediate messages between endpoints.
For extracting XML data from a message you can use a custom processor like:
from("direct:in") .process(new Processor() { public void process(Exchange exchange) { // do stuff to the exchange } }).to("mock:result");
A bit nicer way of extracting things via XPath would be to use a custom bean though:
from("direct:in").beanRef("myBean");
This bean extracts a node list from the message body as the list parameter.
public class MyBean { public void foo(@XPath("/employees/employee") NodeList list) { // do something here } }
Edited by: janstey on Dec 11, 2008 11:07 PM