-
Notifications
You must be signed in to change notification settings - Fork 13
Processors
smecsia edited this page Aug 12, 2014
·
4 revisions
Processor is a message translator. It can receive the messages, perform some actions and then return the result.
Processors are stateless and perform the actions in parallel.
@Filter(instanceof = TestEvent.class)
public class TestBrokenToStringProcessor {
@Processor
public String process(TestBroken event) {
return event.getClass().getName();
}
@Processor
public Object process(Object event) {
return event;
}
}
And describe it in camelot.xml
as processor
<plugin id="test-broken-to-string-processor">
<processor>my.company.TestBrokenToStringProcessor</processor>
</plugin>
You also can use exception handling in processor.