Skip to content

Discovery by monitoring architecture

JGuillemotte edited this page Sep 6, 2011 · 6 revisions

The proxy works with 2 modes :

Discovery mode :

In this mode, the proxy listen for messages, store them in a tree structure and, at the end of the run, analyze them to detect web applications, api's and services and store them in Nuxeo Easy-Soa model. All detected services are registered in Nuxeo. Heuristics are used in combination with a tree to detect api's.

Validated mode :

In this mode, the proxy get the list of registered services from Nuxeo Easy-Soa Model and then listen for messages. When a message is received, it is compared to each entry in the nuxeo service list. If it match, a 'seen service' notification is sent to Nuxeo else the message is stored in a unknown message structure and an alert is send to the user. A mapper pattern is used to map data's form Nuxeo model to java objects (see SoaNodesJsonMapper.java)

Architectural choices :

The proxy works on FraSCAti because there is a lot of extension capabilities (intents, injection ...). In addition, it is possible to deploy it independently or embedded in EasySOA, thanks to SCA and OSGI. The main class of the proxy implements the Servlet interface. HttpClient form Apache httpComponents library is used to redirect the request to the original recipient.

Esper is used for event stream processing to support heavy loads. His role is to aggregate the received messages and to regroup them by services before to send them to Nuxeo for registration. This is to avoid to flood Nuxeo with registration requests when a huge amount of messages is received by the proxy.

Handlers are used to detect the kind of the received messages. Indeed, the way to register services from a SOAP message is somewhat different from that to register form REST Messages. It is easy to extends the capabilities of the proxy by adding new handlers.

Http proxy driver interface for HTTP Proxy :

A client interface is available for the proxy. This interface can be used to start/stop proxy run. A proxy run is a collection of recorded messages that can be 'replayed'. To record messages, a new proxy run must be started. When the run is stopped, the recorded messages are analyzed and the corresponding web services are recorded in Nuxeo EasySOA model.

The interface is started automatically with the proxy and is only available in 'console mode'. The way to send command is to send an http request on the port 8084 (by default) :

* To start a new proxy run : /startNewRun/{runName}
* To stop the current proxy run : /stopCurrentRun

Frascati components :

The HTTP discovery proxy is build with a set of FraSCAti component. Each component specified in one composite file.

Run Manager :

Charged to record the messages received by the proxy (requests and responses). Each message is recorded in a record session : a run. Each run can be replayed directly in the proxy. Each message is send to the monitoring service for analysis.

Monitoring service :

Charged to analyse each message to discover API's and services. At the moment, there are two implementation of the monitoring service : Discovery service and Validated service.

Esper engine :

Event agregator. His role is to regroup and aggregate message events to limit the number of registration requests send to Nuxeo.

Nuxeo registration :

Charged to build API's and services registration requests but also to build requests to get registry content.

Tests :

Several tests are available :

* full mocked tests that works in complete autonomy.
* Partially mocked tests who requires an external Nuxeo system.

Fully mocked tests are automatically executed each time the command mvn install is executed. Partially mocked tests are executed when the following maven profile is executed : 'integration-tests'.

New features :

In future versions, new features will be added :'replay' function, proxy mode change, informations display like message number in the current run .., and a true graphical interface.

Clone this wiki locally