camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hadrian Zbarcea <hzbar...@gmail.com>
Subject Re: Camel with my app
Date Tue, 03 Mar 2009 05:26:09 GMT
Hi Rodrigo,

There is not magic (ok, maybe just a tiny bit).  Try something like  
this:

         CamelContext camel = new DefaultCamelContext();

         // lets add some routes
         container.addRoutes(new RouteBuilder() {
             public void configure() {
                 from("direct:start").process(new Processor() {
                     public void process(Exchange e) {
                         // whatever you want in here
                     }
                 });
             }
         });

         camel.start();


You don't necessarily need spring, but it's a handy way to wire route  
components.  There are plenty of protocols and integration patterns we  
support, please change the "direct:start" endpoint and the content of  
the route at will.

Cheers
Hadrian



On Mar 2, 2009, at 10:15 PM, Rodrigo Valerio wrote:

>
> I try to integrate camel into my app, but without success.
>
> Using spring integration, if i run by Main class (like examples),  
> all run`s
> ok.
>
> How i get a CamelContext or Template instance in my app class?
>
> I see al the documentation, but can`t solve this simple (i think)  
> problem:
> How is the best way to do this.
>
> My webapp class, isn`t instantiated by spring and i don`t any  
> expertise with
> spring too.
>
> Thanks in advance.
> -- 
> View this message in context: http://www.nabble.com/Camel-with-my-app-tp22301780p22301780.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message