Diploma Thesis Santiago Gómez Sáez - IAAS
Diploma Thesis Santiago Gómez Sáez - IAAS
Diploma Thesis Santiago Gómez Sáez - IAAS
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
6.1. SQL Support Implementation<br />
and get operations, where the cashing key, and the data to store are provided. The mysqlproxy.registry<br />
accesses the cache through this interface, but dynamically creates the cashing<br />
key for the object it stores, following the format described in Listing 6.2. Three different types<br />
of information identified by a unique tag are stored in the cache: tenant authentication, tenant<br />
backend data source properties, and query results.<br />
1 CACHE_TENANT_INFO_ID_TAG + "#" + tenantId + "#" + userId + "#" + srcdb + "#" + srcTable;<br />
2 CACHE_TENANT_AUTHENTICATION_TAG + "#" + tenantId + "#" + userId + "#" + srcdb;<br />
3 CACHE_QUERY_RESULT_TAG + "#" + tenantId + "#" + userId + "#" + targetdb + "#" + query;<br />
Listing 6.2: Dynamic creation of cache keys to store the different types of data and metadata.<br />
When the information is not located in the cache, the service registry is queried, and its result<br />
cashed. The CDASMix MySQL proxy establishes a database connection with the PostgreSQL<br />
database server where the service registry is hosted when the component is deployed. A<br />
dedicated connection for this component reduces the latency of creating a database connection<br />
per received MySQL request.<br />
6.1.2. Multi-tenant ServiceMix Camel Service Engine<br />
The ServiceMix-camel-mt JBI SE provides integration support between the Camel router,<br />
and the JBI environment. This SE includes in its package the camel-core libraries, in order<br />
to interact with the camel endpoints which are by default included in it, e.g. camel-email,<br />
camel-jms, camel-http, camel-ftp, etc. Muhler extends in his work this SE in order to include<br />
multi-tenancy awareness [Muh12]. In this subsection we describe the modifications he makes,<br />
and the extensions we develop to make it compatible with the requirements of our system.<br />
The Camel router provides support for describing its routes in two styles: POJO, and Spring.<br />
The former allow programmers to describe the camel routes in a Java class which extends<br />
camel’s RouteBuilder class, while the latter allows the route description in XML format. Files<br />
which describe the routes are packed in SUs, and these in a SA. The CamelSpringDeployer<br />
class in ServiceMix-camel-mt implement the necessary methods for extracting the routes for<br />
deployment. Muhler extends this class in CamelSpringDeployerMT, and includes tenant-aware<br />
operations for injecting tenant-aware information in the service and endpoint URIs. However,<br />
the tenant-aware information is not enough in our system, due to requirements specified in<br />
Chapter 4. Therefore, we extend his work by adding the tenant’s user information in the<br />
multi-tenant information injected in the URIs.<br />
A Camel JBI endpoint is identified by the prefix jbi:, and the endpoints are classified into<br />
two types: consumer, and provider. Consumer endpoints receive message exchanges from<br />
endpoints exposed in the NMR, while providers forward the message exchanges to JBI<br />
endpoints exposed in the NMR, or to external services. The CamelConsumerEndpoint and<br />
CamelProviderEndpoint classes include the endpoint configuration, and the necessary methods<br />
for creating and accepting message exchanges. Hence, we modified them and included<br />
67