You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by James Strachan <ja...@gmail.com> on 2007/11/16 17:24:34 UTC

new bean expression language

An issue some folks have hit has been how to write complex expressions
and predicates for non-XML payloads of messages without adding any new
dependency on some expression language like Groovy, EL, OGNL, Ruby
etc.

Well there's always Java :)

Folks could write a new Expression/Predicate class; but that can often
be a tad noisy when used in the DSL (and it doesn't translate too well
to describing routing rules in XML); so to simplify that I've
implemented a simple Bean Language so you can just refer to bean
methods as an expression or predicate...
http://cwiki.apache.org/CAMEL/bean-language.html

it also helps show some of the power of the Bean Integration annotations
http://activemq.apache.org/camel/bean-integration.html

The nice thing about this approach is if you write an expression in
Java code; your code can avoid the use of Camel APIs; namely to be
just business logic style code using whatever classes ou like.

The JIRA for this feature is here btw
http://issues.apache.org/activemq/browse/CAMEL-226

As usual, feedback always appreciated
-- 
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com

Re: new bean expression language

Posted by James Strachan <ja...@gmail.com>.
On 16/11/2007, Bruce Snyder <br...@gmail.com> wrote:
> On Nov 16, 2007 9:24 AM, James Strachan <ja...@gmail.com> wrote:
> > An issue some folks have hit has been how to write complex expressions
> > and predicates for non-XML payloads of messages without adding any new
> > dependency on some expression language like Groovy, EL, OGNL, Ruby
> > etc.
> >
> > Well there's always Java :)
> >
> > Folks could write a new Expression/Predicate class; but that can often
> > be a tad noisy when used in the DSL (and it doesn't translate too well
> > to describing routing rules in XML); so to simplify that I've
> > implemented a simple Bean Language so you can just refer to bean
> > methods as an expression or predicate...
> > http://cwiki.apache.org/CAMEL/bean-language.html
> >
> > it also helps show some of the power of the Bean Integration annotations
> > http://activemq.apache.org/camel/bean-integration.html
> >
> > The nice thing about this approach is if you write an expression in
> > Java code; your code can avoid the use of Camel APIs; namely to be
> > just business logic style code using whatever classes ou like.
> >
> > The JIRA for this feature is here btw
> > http://issues.apache.org/activemq/browse/CAMEL-226
> >
> > As usual, feedback always appreciated
>
> Are there any full working examples of this new bean expression
> language? Docs are never as good as seeing some example code that
> actually runs.

Good point! :)

Here's a Java DSL test case...
https://svn.apache.org/repos/asf/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MethodFilterTest.java

also we use this in the Aggregator Spring XML test case
https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aggregator.xml

I've added these links to the wiki page
http://cwiki.apache.org/CAMEL/bean-language.html
-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Re: new bean expression language

Posted by Bruce Snyder <br...@gmail.com>.
On Nov 16, 2007 9:24 AM, James Strachan <ja...@gmail.com> wrote:
> An issue some folks have hit has been how to write complex expressions
> and predicates for non-XML payloads of messages without adding any new
> dependency on some expression language like Groovy, EL, OGNL, Ruby
> etc.
>
> Well there's always Java :)
>
> Folks could write a new Expression/Predicate class; but that can often
> be a tad noisy when used in the DSL (and it doesn't translate too well
> to describing routing rules in XML); so to simplify that I've
> implemented a simple Bean Language so you can just refer to bean
> methods as an expression or predicate...
> http://cwiki.apache.org/CAMEL/bean-language.html
>
> it also helps show some of the power of the Bean Integration annotations
> http://activemq.apache.org/camel/bean-integration.html
>
> The nice thing about this approach is if you write an expression in
> Java code; your code can avoid the use of Camel APIs; namely to be
> just business logic style code using whatever classes ou like.
>
> The JIRA for this feature is here btw
> http://issues.apache.org/activemq/browse/CAMEL-226
>
> As usual, feedback always appreciated

Are there any full working examples of this new bean expression
language? Docs are never as good as seeing some example code that
actually runs.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/
Castor - http://castor.org/