Nice work Jervis. I think we both share a lot of the same concerns about this approach. Some thoughts:
1. From a CXF point of view an address is typically associated with one service/endpoint. It seems odd to require people to register each service on a different endpoint and then have another endpoint which routes between them. From a conceptual point of view a user wants to associate multiple services with a single endpoint. Or, in your example, what if the user just wants to expose the http://localhost:9027/SoapContext/SoapPort endpoint and not http://localhost:9027/SoapContext1/SoapPort? I guess there are a few ways around this. The simplest would be to use some kind of local service transport which the mediation interceptor could route with. Endpoint.publish("service://service1", service1); Endpoint.publish("service://service2", service2); Endpoint.publish("http://localhost/myService", routingService); There is also the means that I outlined in that email that you linked to in your previous email. 2. Complexity - I think this one is easier to fix. We can create helper classes to set up the routing. For instance something like this: XPathRoutingServerFactory service = new XPathRoutingServerFactory(); service.route("/foo/service1', "service://service1"); service.route("/foo/service2', "service://service2"); service.setAddress("http://localhost/myService"); Server server = service.create(); Or it could use Camel (which is looking very cool btw). Maybe we can a look at making our 1:1 association with Endpoints and addresses a little looser as I think that would be conceptually a lot better. I don't really know what all this entails though. I'll try to take a look into it the next two days. - Dan On 3/23/07, Liu, Jervis <[EMAIL PROTECTED]> wrote:
Hi, I've been experimenting a bit on the service routing lately, the result has been put on the wiki: http://cwiki.apache.org/confluence/display/CXF20DOC/Service+Routing. So it works ((I will check in a system test shortly), my main concern though, is that this implementation does not seem to be very "simple", it does require a fair amount of knowledge of CXF internal. Not sure if it is appropriate to expose this to CXF userland. Anyway, I am open to any comments&suggestions. Thanks, Jervis > -----Original Message----- > From: Dan Diephouse [mailto:[EMAIL PROTECTED] > Sent: 2007?3?17? 3:32 > To: [email protected] > Subject: Re: Release Update > > > On 3/15/07, Liu, Jervis <[EMAIL PROTECTED]> wrote: > > > > > > > > > -----Original Message----- > > > From: Dan Diephouse [mailto:[EMAIL PROTECTED] > > > Sent: 2007?3?15? 21:44 > > > To: [email protected] > > > Subject: Re: Release Update > > > > > > > > > Hi Jervis, > > > > > > I wanted to ensure that we can setup an endpoint on a URL > and route to > > > different services based on headers (such as ws-a) or other > > > logic. I made a > > > series of proposals about how to do this a while back, but I > > > don't think we > > > ever came to any concrete conclusion. > > > > > Ok, I see what you mean. I believe you are referring to > this proposal [1]. > > One thing I have not figured out from the proposal yet is > how we know the > > addresses of services to which the routing service is about > to redirect? > > Through some kind of registries or a configuration loaded > from a separate > > file or a WSDL extension.? Once this kind of discussion > gets started, I do > > not see how it can end by the end of this release. Service > routing is a huge > > topic anyway. However we will have much less to worry about > if we are not > > after a complete resolution of service routing. For > example, if we only > > support the routing among different endpoints within the > same Destination, > > would this feature be considered helpful for some certain > use cases? Reading > > your proposal, I believe this is also what you want to do, > start from sth > > simple first. If this is the case, I am ready to get my > hands dirty now. > > > > BTW, I am in a traveling at the moment, I may not respond > in time until I > > get back to office next Tuesday. > > > > [1]. > > > http://mail-archives.apache.org/mod_mbox/incubator-cxf-dev/200 612.mbox/[EMAIL PROTECTED] Yes, I'm really just concerned about the simple case. Namely being able to create some type of routing endpoint which routes to other types of services. My main use cases is versioning of services. Ideally many services can share the same URL and I can route by headers or the namespace of the body part. Regarding how to know what services to route to - I think its up to the user to write that code. I was kind of envisioning that it'd be an interceptor that a user writes. We could build something more formal like a registry, but we would need something low level first :-) - Dan -- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog
-- Dan Diephouse Envoi Solutions http://envoisolutions.com | http://netzooid.com/blog
