Skip to content
lukaszPulawski edited this page May 26, 2015 · 4 revisions

The mechanics of the Ratel on both client and server is based on standard mechanisms of the Spring container.

Server side

@Publish //This bean will be made available by http exporter and registered in the service registry
public class MyServiceImplementation
    implements MyService /*<- first implemented interface */, Serializable {

On server side, when service application context is starting up, ServiceRegisterPostProcessor after initialization, finds all beans annotated with @Publish annotation and does the following things:

After this is done, the clients can bind to the address of the service and send requests to it.

Client side

public class MyClientApp {

   @Discover
   MyService serviceClient; //<- lazy proxy for _MyService_ will be injected here

On client side, when application context is starting, during the properties populating phase, RemoteAutowireCandidateResolver resolves all autowired injection points annotated with @Discover annotation and injects a lazy proxy bound to the declared field/parameter type. The endpoints for this service will discovered at a first usage of the proxy.

For more details please refer to section Examples

Clone this wiki locally