Hi Yeah we have also talked about a fluent builder for setting component options. But 1st goal is all the endpoints.
On Thu, Jun 6, 2019 at 12:21 PM Pasquale Congiusti <pasquale.congiu...@gmail.com> wrote: > > Hey Guillame, > recently I was looking at something similar on component side in order to > make an integration archetype. I was thinking to use the annotations on the > endpoint (@UriEndpoint, @UriPath, @UriParam) in order to scan which are the > available parameters, and, from there onward being able to map the > available options of such components. I guess you can scan those at runtime > and being even able to make a fluent builder fully automated. > > Let me know how if you need any further info to develop such idea. > > Cheers, > Pasquale. > > On Thu, Jun 6, 2019 at 12:01 PM Guillaume Nodet <gno...@apache.org> wrote: > > > I've just pushed a working test case: > > > > > > https://github.com/apache/camel/blob/bcaa3ce64d9f1a5fd2ee9fcb154c7a2682c9979e/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumeCharsetTest.java#L57-L59 > > > > It's missing the generation of the dsl methods for each endpoint consumer / > > producer (see > > > > https://github.com/apache/camel/blob/bcaa3ce64d9f1a5fd2ee9fcb154c7a2682c9979e/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumeCharsetTest.java#L64-L69 > > ) > > but I'm not sure yet where/how to nicely plug them in the DSL. > > > > Ideas and feedback welcome ! > > > > > > Le mer. 5 juin 2019 à 23:23, Guillaume Nodet <gno...@apache.org> a écrit : > > > > > I just pushed a branch called "endpoint-dsl". > > > > > > My goal is to experiment with an auto-generated DSL for endpoints, mainly > > > to have a complete and type-safe java DSL for endpoints instead of using > > > URI containing all the parameters. Right now, it compiles but isn't > > really > > > usable at a DSL. > > > I'll get back as soon as I have something which can actually be used so > > > that we can discuss further various options. > > > My rough goal is to be able to write something like: > > > > > > from(file("target/data/foo").delay(4000).backoffMultiplier(4 > > > ).backoffIdleThreshold(2).backoffErrorThreshold(3)) > > > .to(mock("result")) > > > > > > instead of > > > > > > from( > > > > > "file://target/data/foo?delay=4000&backoffMultiplier=4&backoffIdleThreshold=2&backoffErrorThreshold=3" > > > ) > > > .to("mock:result") > > > > > > Stay tuned ! > > > > > > -- > > > ------------------------ > > > Guillaume Nodet > > > > > > > > > > -- > > ------------------------ > > Guillaume Nodet > > -- Claus Ibsen ----------------- http://davsclaus.com @davsclaus Camel in Action 2: https://www.manning.com/ibsen2