Skip to content

Messaging API and templating engine

JGuillemotte edited this page Feb 1, 2012 · 12 revisions
  • Messaging API :

See https://github.com/easysoa/EasySOA/tree/master/easysoa-registry/easysoa-registry-api/easysoa-registry-api-messaging

This API contains classes to define HTTP messages and exchange records.

HTTP Message is used to build a java reprensentation of an HTTP message so it contains all the informations concerning the request and the response. Exchange record objects are used to store the HTTP messages.

This API is used at the moment by the HTTP Discovery proxy.

  • Templating engine

Correlation service : This service make an analysis of the request to define the most interessant fields. It is working with a correlation mechanism, comparing the request with the response.

TemplateBuilder : Builds a template from the field suggested by the correlation service and the exchange record. This template is mad with Velocity. Each suggested field is replaced in the request by a velocity expression (eg : $arg2.get("key"). Then, this 'custom' exchange is stored and can be used by the TemplateRenderer.

TemplateRenderer : Render a template by replacing the template expressions by the provided values. Then the result can be used by the tamplate executor.

TemplateExecutor : Execute the rendered template (send the request, using the utility class RequestForwarder) and returns the response.

  • Custom ProxyImplementationVelocity class

The proxyImplementationVelocity is modified to work with the TemplateRenderer. The velocity engine is configurated to work with an interface and a class instead of a servlet. See the HTTP Discovery proxy composite file, especially the code concerning the ProxyWSTemplate component (https://github.com/easysoa/EasySOA/blob/master/easysoa-proxy/easysoa-proxy-core/easysoa-proxy-core-httpdiscoveryproxy/src/main/resources/httpDiscoveryProxy.composite)

  • Custom ServletImplementationVelocity class

This class has been modified to provide Easysoa custom features : - Returns the list of exchange stores when a request ending by "/target" is received. The list is returned as an HTML page. - Returns a WDSL corresponding to the records contained in an exchange store. The WSDL file is generated by loading and processing a pre-defined template.

Clone this wiki locally