easysoa / EasySOA

A light, collaborative platform to make Service Oriented Architecture simple.
http://www.easysoa.org
35 stars 8 forks source link

ServiceDiscoveryMapper across apps and envs #95

Open mdutoo opened 12 years ago

mdutoo commented 12 years ago

ServiceDiscoveryMapper

service discovery works like this : SDService.discoverService(env / use context, service info including url)

Its server implementation has to be able to find the right application and map with other environments (ex. dev vs staging), here's how it must be done.

Server implementation has to be handled by a chain of different implementations of ServiceDiscoveryMappers. Each implementation uses conf contained in each app(Impl) in one or more SDMapperConf (sdmapperconf in the model).

1 SDServicesRootMapper : (default and most useful one) a SDMapper where only a root part of all service url is abstracted / propertized across envs. How it works :

2 LATER SDRegexpMapper : any part of the URL can be abstracted / propertized across envs. It works like SDServicesRootMapper, except select is done using matchesRegexp() instead of startsWith(). Nuxeo doesn't provide this for now, so (either add it or) rather develop a SDRegexpServiceRootMapper which does regexp using Java only on the result of the select of the SDServiceRootMapper part.

Service mapping across environments is then achieved : either by adapting the service url just the same way according to its sdmapperconf when crossing in another environment, or by storing also the relative url when first adding the service.

Note that this is actually an application of #75 "templatized properties".

With deployable discovery

When (provided or consumed) services are discovered within deployables during deployable discovery (see #97), deployable discovery configuration can feed the env / use context, such as which deployable provides or consumes it, ex. FraSCAti composite discovery (but also ex. which project & app, as configured in maven deployable discovery plugin).

AppImplConfProducer

Does the opposite : in a file (served in HTTP, or as a maven artifact...) outputs $serviceName=$servicesRootUrl/$serviceUrlRightPart for all services of the selected env (or even for all consumed services i.e. references of the selected AppImpl).

Transiting to another env

The user either creates a new env and copies the AppImpl in it (env fork), then inputs the changed rootServicesUrl ; or chooses an existing env to update, in which case the rootServicesUrl is kept and the appImpl replaced. NB. in both cases checks are done afterwards, typically through validation, especially in the second case.

DONE first impl on current model

mkalam-alami commented 12 years ago

Basic ServiceRootMapper commited with aceb937c7c