Creating routes in Java
void addRoutesToCamelContext(CamelContext context)
throws Exception
from returns RouteDefinitionObject
DSL – Domain Specific language
TypeConvertor
// add our own type converter manually that converts from String -> MyOrder using MyOrderTypeConverter
context.getTypeConverterRegistry().addTypeConverter(MyOrder.class, String.class, new MyOrderTypeConverter());
// add our own type converter manually that converts from String -> MyOrder using MyOrderTypeConverter
context.getTypeConverterRegistry().addTypeConverter(MyOrder.class, String.class, new MyOrderTypeConverter());
MyOrder order = context.getTypeConverter().convertTo(MyOrder.class, "123");
adding a processor
from(ftp://myftpsite.com/friends?username=MazalShadon&password=123456).
process(new Processor() {
public void process(Exchange exchange) throws Exception {
System.out.println("Comming from ftp: "
+ exchange.getIn().getHeader("CamelFileName"));
}
}).
to("jms:myFriends");
אין תגובות:
הוסף רשומת תגובה