camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Proxying of RouteBuilder causes problem through CamelConextFactoryBean
Date Sun, 05 Apr 2009 11:16:51 GMT
On Sun, Apr 5, 2009 at 12:30 PM, christian_seufert
<christian.seufert@icw.de> wrote:
>
> Hi,
> first of all I want to say that Apache Camel is a great product...
>
> Now, here is my question: We are using in our application a special
> mechanism for modularization that requires that all Spring beans have to be
> exported with an interface and are proxied. Since the only interface we can
> use for the RouteBuilder class is org.apache.camel.routes we are faced with
> the problem that when the CamelContextFactoryBean tries to install the
> routeBuilders (installRoutes method) it is looking only for RouteBuilder
> instances in the Spring context:
>
> if (builderRefs != null) {
>            for (RouteBuilderRef builderRef : builderRefs) {
>                CamelContextHelper.lookup(camelContext, ref,
> RouteBuilder.class);
>                RouteBuilder builder =
> builderRef.createRouteBuilder(getContext());
>                getContext().addRoutes(builder);
>            }
>
> But our routebuilder beans are proxied by the Routes interface so that there
> is a Classcast problem. The solution for this problem was to look for Routes
> instances instead of RouteBuilder instances:
>
> if (builderRefs != null) {
>            for (RouteBuilderRef builderRef : builderRefs) {
>                Routes routes =
> CamelContextHelper.lookup(context,builderRef.getRef(), Routes.class);
>                getContext().addRoutes(routes);
>            }
>        }
>
> This workaround is working fine, so my question is if it wouldn't be more
> appropriate to look for Routes instances?
Hi

Yeah that looks doable. Using the Routes interface instead of the
RouteBuilder abstract class.

Do you mind creating a ticket in JIRA for this?
http://camel.apache.org/support.html

>
> Cheers,
> christian
>
>
> --
> View this message in context: http://www.nabble.com/Proxying-of-RouteBuilder-causes-problem-through-CamelConextFactoryBean-tp22892487p22892487.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Apache Camel Reference Card:
http://refcardz.dzone.com/refcardz/enterprise-integration

Mime
View raw message