You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Raphael Parree <rp...@edc4it.com> on 2016/03/01 08:18:18 UTC

ScalaRouteBuilder with CDI

Hi,

I am porting some of my camel demos to CDI (for FIS/Fabric8).
The RouteBuilder has been deprecated a while back in favour of the
ScalaRouteBuilder which requires a constructor value for the CamelContext.
I can only get it to work with the deprecated RouteBuilder as i am
unsuccessful so far injecting a value for the CamelContext. In addition one
can use the @CamelContext to define the context for the route.

Is there a recommended approach or does it need a change in
the org.apache.camel.cdi.internal.CamelContextConfig?

tx.,



-- 
Raphaël Parrée
EDC4IT Europe BV
(m) +33 673 75 34 62
(p) + 31 88 584 8895
@rparree <https://twitter.com/intent/user?screen_name=rparree> | LinkedIn
<http://fr.linkedin.com/in/rparree>

-- 
EDC4IT Europe BV is a company registered in the Netherlands. Registered 
number: 58704663. Registered office: Leeghwaterstraat 25, 2811 DT Reeuwijk. 
| This communication is for use by the intended recipient and contains 
information that may be privileged, confidential or copyrighted under 
applicable law. If you are not the intended recipient, you are hereby 
formally notified that any use, copying or distribution of this e-mail, in 
whole or in part, is strictly prohibited. Please notify the sender by 
return e-mail and delete this e-mail from your system. Unless explicitly 
and conspicuously designated as " E-Contract Intended", this e-mail does 
not constitute a contract offer, a contract amendment, or an acceptance of 
a contract offer. This e-mail does not constitute a consent to the use of 
sender's contact information for direct marketing purposes or for transfers 
of data to third parties. | info@edc4it.com. 



Re: ScalaRouteBuilder with CDI

Posted by Antonin Stefanutti <an...@stefanutti.fr>.
Hi Raphaël,

CDI requires a default constructor so that it can creates proxies for beans. So the obvious solution may be to add a default constructor to the ScalaRouteBuilder class, as the RouteBuilder class does.

For your information, the Camel CDI component has been rewritten for the upcoming 2.17.0 release so that classes like CamelContextConfig no longer exists. The documentation has been updated: http://camel.apache.org/cdi.html and some new samples have been contributed as well.

That’d be great to complement these samples with a Camel CDI Scala one. So if you have a demo sample to share, that may serve as the basis for it and I’d be glad to help make it works.

Antonin

> On 01 Mar 2016, at 08:18, Raphael Parree <rp...@edc4it.com> wrote:
> 
> Hi,
> 
> I am porting some of my camel demos to CDI (for FIS/Fabric8).
> The RouteBuilder has been deprecated a while back in favour of the
> ScalaRouteBuilder which requires a constructor value for the CamelContext.
> I can only get it to work with the deprecated RouteBuilder as i am
> unsuccessful so far injecting a value for the CamelContext. In addition one
> can use the @CamelContext to define the context for the route.
> 
> Is there a recommended approach or does it need a change in
> the org.apache.camel.cdi.internal.CamelContextConfig?
> 
> tx.,
> 
> 
> 
> -- 
> Raphaël Parrée
> EDC4IT Europe BV
> (m) +33 673 75 34 62
> (p) + 31 88 584 8895
> @rparree <https://twitter.com/intent/user?screen_name=rparree> | LinkedIn
> <http://fr.linkedin.com/in/rparree>
> 
> -- 
> EDC4IT Europe BV is a company registered in the Netherlands. Registered 
> number: 58704663. Registered office: Leeghwaterstraat 25, 2811 DT Reeuwijk. 
> | This communication is for use by the intended recipient and contains 
> information that may be privileged, confidential or copyrighted under 
> applicable law. If you are not the intended recipient, you are hereby 
> formally notified that any use, copying or distribution of this e-mail, in 
> whole or in part, is strictly prohibited. Please notify the sender by 
> return e-mail and delete this e-mail from your system. Unless explicitly 
> and conspicuously designated as " E-Contract Intended", this e-mail does 
> not constitute a contract offer, a contract amendment, or an acceptance of 
> a contract offer. This e-mail does not constitute a consent to the use of 
> sender's contact information for direct marketing purposes or for transfers 
> of data to third parties. | info@edc4it.com. 
> 
>