You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Martin Gilday <ma...@imap.cc> on 2008/10/21 13:17:01 UTC
Non registry beans
I am looking at the section "Non registry beans" on the page
http://activemq.apache.org/camel/bean-language.html
I am using 1.5-SNAPSHOT
This states to try:
from("activemq:OrdersTopic").filter().expression(bean(MyBean.class,
"isGoldCustomer")).to("activemq:BigSpendersQueue");
However this does not compile. bean is not available inside expression.
I would like to alter this to use bean language inside a Choice but the
same problem exists. What is the correct way to write this route?
I want to use non registry beans as I am writing it inside a non-Spring
managed test.
Thanks,
Martin
RE: Non registry beans
Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi
Please create a ticket in JIRA so we can get it fixed, hopefully in 1.5.
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Martin Gilday [mailto:martin.lists@imap.cc]
Sent: 21. oktober 2008 14:10
To: camel-user@activemq.apache.org
Subject: Re: Non registry beans
Should I take it off the page then
http://activemq.apache.org/camel/bean-language.html ?
As it quite clearly states it is in 1.5.
Unless I am mistaken the following problems exist:
bean() is not available inside expression()
method(Class type, String methodName) is not available.
----- Original message -----
From: "James Strachan" <ja...@gmail.com>
To: camel-user@activemq.apache.org
Date: Tue, 21 Oct 2008 13:02:54 +0100
Subject: Re: Non registry beans
2008/10/21 Martin Gilday <ma...@imap.cc>:
> I think there is only method() insted of methodCall() which differs from
> Java DSL to Spring DSL.
>
> What I think I really need is
> from("").choice().when().method(null, null).to("").otherwise().to("");
Yes thats the one
> However looking at the example I posted first (which doesn't compile) it
> says you should be able to put the name of a class rather than a bean
> name
> from("activemq:OrdersTopic").filter().expression(bean(MyBean.class,
> "isGoldCustomer")).to("activemq:BigSpendersQueue");
>
> Is this still under development or should it be in 1.5-SNAPSHOT?
We don't yet support the method(Class type, String methodName) method
in the Java DSL. We should add this!
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/
Re: Non registry beans
Posted by Martin Gilday <ma...@imap.cc>.
Should I take it off the page then
http://activemq.apache.org/camel/bean-language.html ?
As it quite clearly states it is in 1.5.
Unless I am mistaken the following problems exist:
bean() is not available inside expression()
method(Class type, String methodName) is not available.
----- Original message -----
From: "James Strachan" <ja...@gmail.com>
To: camel-user@activemq.apache.org
Date: Tue, 21 Oct 2008 13:02:54 +0100
Subject: Re: Non registry beans
2008/10/21 Martin Gilday <ma...@imap.cc>:
> I think there is only method() insted of methodCall() which differs from
> Java DSL to Spring DSL.
>
> What I think I really need is
> from("").choice().when().method(null, null).to("").otherwise().to("");
Yes thats the one
> However looking at the example I posted first (which doesn't compile) it
> says you should be able to put the name of a class rather than a bean
> name
> from("activemq:OrdersTopic").filter().expression(bean(MyBean.class,
> "isGoldCustomer")).to("activemq:BigSpendersQueue");
>
> Is this still under development or should it be in 1.5-SNAPSHOT?
We don't yet support the method(Class type, String methodName) method
in the Java DSL. We should add this!
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/
Re: Non registry beans
Posted by James Strachan <ja...@gmail.com>.
2008/10/21 Martin Gilday <ma...@imap.cc>:
> I think there is only method() insted of methodCall() which differs from
> Java DSL to Spring DSL.
>
> What I think I really need is
> from("").choice().when().method(null, null).to("").otherwise().to("");
Yes thats the one
> However looking at the example I posted first (which doesn't compile) it
> says you should be able to put the name of a class rather than a bean
> name
> from("activemq:OrdersTopic").filter().expression(bean(MyBean.class,
> "isGoldCustomer")).to("activemq:BigSpendersQueue");
>
> Is this still under development or should it be in 1.5-SNAPSHOT?
We don't yet support the method(Class type, String methodName) method
in the Java DSL. We should add this!
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/
Re: Non registry beans
Posted by Martin Gilday <ma...@imap.cc>.
I think there is only method() insted of methodCall() which differs from
Java DSL to Spring DSL.
What I think I really need is
from("").choice().when().method(null, null).to("").otherwise().to("");
However looking at the example I posted first (which doesn't compile) it
says you should be able to put the name of a class rather than a bean
name
from("activemq:OrdersTopic").filter().expression(bean(MyBean.class,
"isGoldCustomer")).to("activemq:BigSpendersQueue");
Is this still under development or should it be in 1.5-SNAPSHOT?
The closest I have got is:
from("direct:test").choice().when().expression(BeanLanguage.bean(TimingExpressionBean.class,
"isReady")).to("mock:now").otherwise().to("mock:later");
Which throws a NoSuchLanguageException.
----- Original message -----
From: "James Strachan" <ja...@gmail.com>
To: camel-user@activemq.apache.org
Date: Tue, 21 Oct 2008 12:53:08 +0100
Subject: Re: Non registry beans
2008/10/21 Martin Gilday <ma...@imap.cc>:
> from().filter().expression() does not seem to exist. Only
> expression(Expression)
Sorry I meant
from().filter().
which should let you pick
from().filter().methodCall(...
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/
Re: Non registry beans
Posted by James Strachan <ja...@gmail.com>.
2008/10/21 Martin Gilday <ma...@imap.cc>:
> from().filter().expression() does not seem to exist. Only
> expression(Expression)
Sorry I meant
from().filter().
which should let you pick
from().filter().methodCall(...
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/
Re: Non registry beans
Posted by Martin Gilday <ma...@imap.cc>.
from().filter().expression() does not seem to exist. Only
expression(Expression)
----- Original message -----
From: "James Strachan" <ja...@gmail.com>
To: camel-user@activemq.apache.org
Date: Tue, 21 Oct 2008 12:44:44 +0100
Subject: Re: Non registry beans
2008/10/21 Martin Gilday <ma...@imap.cc>:
> I am looking at the section "Non registry beans" on the page
> http://activemq.apache.org/camel/bean-language.html
> I am using 1.5-SNAPSHOT
>
> This states to try:
> from("activemq:OrdersTopic").filter().expression(bean(MyBean.class,
> "isGoldCustomer")).to("activemq:BigSpendersQueue");
if you close the parens
from("activemq:OrdersTopic").filter().expression().
then your IDE should smart complete the available expressions.
The actual expression you're looking for is methodCall() which uses a
bean as an expression
from("activemq:OrdersTopic").filter().expression().methodCall(MyBean.class,
"isGoldCustomer").to...
> I want to use non registry beans as I am writing it inside a non-Spring
> managed test.
It should work fine in plain Java with JNDI as a registry, with Spring
or with Guice
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/
Re: Non registry beans
Posted by James Strachan <ja...@gmail.com>.
2008/10/21 Martin Gilday <ma...@imap.cc>:
> I am looking at the section "Non registry beans" on the page
> http://activemq.apache.org/camel/bean-language.html
> I am using 1.5-SNAPSHOT
>
> This states to try:
> from("activemq:OrdersTopic").filter().expression(bean(MyBean.class,
> "isGoldCustomer")).to("activemq:BigSpendersQueue");
if you close the parens
from("activemq:OrdersTopic").filter().expression().
then your IDE should smart complete the available expressions.
The actual expression you're looking for is methodCall() which uses a
bean as an expression
from("activemq:OrdersTopic").filter().expression().methodCall(MyBean.class,
"isGoldCustomer").to...
> I want to use non registry beans as I am writing it inside a non-Spring
> managed test.
It should work fine in plain Java with JNDI as a registry, with Spring
or with Guice
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://fusesource.com/