You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Denis Krizanovic <de...@gmail.com> on 2013/10/08 11:38:21 UTC
Extending Camel Java DSL with new verb?
Hi Guys,
Just wondering if it's a good idea to extend the DSL with a custom verb.
Our goal is to remove the "non-functional" concerns out of the route
configuration. In particular, by adding a
.audit("message here")
This verb generates an ibm cbe event and sticks it on the queue.
We've tried creating a component, but we get something like;
.to("audit:monitoring?eventtype=CreateCustomer&msg=message%20here"
which ends up looking quite ugly.
We've been using processors until now, but I think the readability of an
additional verb would be very expressive compared to a new component.
Any advice/guidance.
thanks,
dk-
Re: Extending Camel Java DSL with new verb?
Posted by Charles Moulliard <ch...@gmail.com>.
The point that you raise here is not new and is certainly a thing that we
should take care in the future of Camel as they improve the
readability/expressiveness of a camel route by adding a 'concern' which is
not specifically link to a processor, component but add a global behavior
to a camel route like 'transacted'.
The questions that we will have immediately is we offer the possibility to
extend or add new verbs will be :
- Is the verb link to a processor, component, interceptor or link to
another camel route ?
- What is the scope : 'local' to my camel route or just where we add it in
the camel route ?
- Verb should be perhaps decorrelate from the route itself like
onException, interceptFrom to avoid my previous questions
ex.
audit().enable()
from().....to()
On Tue, Oct 8, 2013 at 11:38 AM, Denis Krizanovic <
denis.krizanovic@gmail.com> wrote:
> Hi Guys,
>
> Just wondering if it's a good idea to extend the DSL with a custom verb.
> Our goal is to remove the "non-functional" concerns out of the route
> configuration. In particular, by adding a
>
> .audit("message here")
>
> This verb generates an ibm cbe event and sticks it on the queue.
>
> We've tried creating a component, but we get something like;
>
> .to("audit:monitoring?eventtype=CreateCustomer&msg=message%20here"
>
> which ends up looking quite ugly.
>
> We've been using processors until now, but I think the readability of an
> additional verb would be very expressive compared to a new component.
>
> Any advice/guidance.
>
> thanks,
> dk-
>
--
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog : http://cmoulliard.github.io