Hi, I’m not a not a big fan of this type safe endpoint configuration.
As the endpoints are different from each other, you cannot define a unified fluent API for all the endpoints. But Camel does support to define the Endpoint in the pure Java way, but it is not as easy as using the URI to setup the endpoint. BTW, the good part of URI is we can build the endpoint from Java, Spring or Blueprint without change any thing. -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Sunday, November 17, 2013 at 8:10 PM, ChristianSchaefer wrote: > Hello there, > > after working with a camel for some months I wondered from time to time if > there is a possibility to define endpoints a bit more typesafe way because > writing URI strings is prone to typos/property-mismatch and (imho) not > really supported by an IDE. > Furthermore the developing includes writing code, reading the doc to get > that property's name and pasting it in the code. > > As I didn't find anything like that except > (http://camel.465427.n5.nabble.com/Endpoint-URI-typesafety-td5733594.htm), I > had an idea to write the consumer config as the following file copy example > demonstrates. > > (adapted from the camel in action book example in chapter 1): > > *from(new FileConsumerTemplate("data/inbox") > .setNoop(true) > .setRecursive(true) > .get()) > > .log("going to copy file..") > .to("file:data/outbox");* > > This way one could use endpoint specific template classes which implement > methods for the specific properties (enabling IDE auto suggestion) where one > could also put the camel documentation at. > > Have a look at the complete working example code (quickly hacked so there > are surely some points to optimize.) > > http://pastebin.com/JvMQ3wpG > http://pastebin.com/Vn3z3sRc > http://pastebin.com/Zjs3Jrp3 > (Alternatively the complete package in a zip: > https://dl.dropboxusercontent.com/u/34369176/typesafeProdCons.zip) > > Tell/write me what you think please . > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/typesafe-endpoint-configuration-approach-tp5743391.html > Sent from the Camel - Users mailing list archive at Nabble.com > (http://Nabble.com).