I am still here, working out the way I will handle REST services with Camel.

I had to take a detour from the integration business and dive into web 
applications. I ended up landing on Spring zone, and came to the decision that 
all our projects will use Spring MVC Web and Spring MVC Portlets. But then, 
this brought me back to the way I am wiring the Camel REST endpoint with the 
actual Java logic:

  from("restlet:http://localhost:9080/account/{id}?restletMethod=get";
    .to("bean://myService ");

The same requirement exists in a web app, where a request must be mapped to a 
business object. In Spring MVC this is done like this:

  @Controller
  @RequestMapping("/appts")
  public class AppointmentsController
  {

    @RequestMapping(value="/owners/{oid}", method=RequestMethod.GET)
    public String findOwner(@PathVariable("oid") String oid,
                            Model model)
    {
      // implementation omitted
    }
  }

This maps URL "/appts/owners/34" to the findOwner() method, and the oid 
parameter is mapped to "34". This is in addition to many other benefits of 
using Spring in the business logic.

So, my question is: is it possible to magically go from the Camel from("") 
route definition to a Spring MVC implementation of the business logic?

If I am talking nonsense, apologies in advance.

-- 
Gonzalo Diethelm

Reply via email to