> 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?

Let me clarify my question a bit: I would love to be able to do this:

  from("INPUT:http://localhost:9080/account";)
    .to("PROCESS://magic");

The meaning of this route would be:

1. Register "http://localhost:9080/account/"; as the URL for a Camel endpoint. I 
have no idea what "INPUT" could be; I am guessing it might be "jetty" or 
"servlet".

2. An hits on that URL or anything "hanging" from there should be forwarded to 
"magic", which is a Java class that implements the @Controller Spring 
annotation. I have no idea what "PROCESS" would be...

3. This class is declared like this:

  @Controller
  @RequestMapping("/account")
  public class MagicController
  {
    @RequestMapping(value="/owners/{oid}", method=RequestMethod.GET)
    public String findOwner(@PathVariable("oid") String oid,
                            Model model)
    { /*blah*/ }

    @RequestMapping(value="/{aid}", method=RequestMethod.POST)
    public String createAccount(@PathVariable("aid") String aid,
                                Model model)
    { /*blah*/ }
  }

In other words, I would like to have a single Java class that handles all URLs 
hanging from the one my Camel route is defined for. And this class should be 
allowed to use Spring to access all things related to the request (URL path 
parameters, headers, cookies, body, etc.), using all the Spring goodness that 
has been created for these purposes.

> If I am talking nonsense, apologies in advance.

Ditto.

-- 
Gonzalo Diethelm

Reply via email to