Petals-BC-SQL 1.8.0+

Version 1 by Christophe DENEUX
on Mar 06, 2019 17:08.

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (28)

View Page History

{warning}
* This version must be installed on [Petals ESB 5.2.0|petalsesb520:Petals 5.3.0|petalsesb530:Petals ESB 5.23.0]+,
* and, JDBC drivers must be compliant with JDBC 4.1.
{warning}
{code}


h2. Service Unit Configuration

h3. Service Unit descriptor
All needed information must be defined in the service-unit JBI descriptor. This JBI descriptor is configured through parameters divided in following groups:
* *JBI parameters* that defines the service provider identification,
* *CDK parameters* that are parameters driving the service provider implementation at CDK layer,
* *CDK interceptor parameters* that are parameters driving interceptors at CDK layer,
* *Dedicated parameters* that are parameters driving the service provider implementation at component layer.

The SQL component creates JDBC DataSource initialized with the Service Unit parameters.
Here is a sample of a SU JBI descriptor to configure a MYSQL service.
{code:xml}
<jbi:jbi version="1.0"
xmlns:interfaceNs="http://petals.ow2.org/components/sql/version-1"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:serviceNs="http://test"
xmlns:sql="http://petals.ow2.org/components/sql/version-1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Import a Service into PEtALS or Expose a PEtALS Service => use a BC. -->
<jbi:services binding-component="true">
<!-- Import a Service into PEtALS => provides a Service. -->
<jbi:provides
interface-name="interfaceNs:SQLInterface"
service-name="serviceNs:MyDatabaseSQLService"
endpoint-name="MyDatabaseSQLServiceEndpoint">
<!-- CDK specific elements -->
<petalsCDK:wsdl>SQLService.wsdl</petalsCDK:wsdl>
<!-- Component specific elements -->
<sql:url>jdbc:mysql://host_name:port/dbname</sql:url>
<sql:user>test</sql:user>
<sql:password>test</sql:password>
<sql:maxActive>8</sql:maxActive>
<sql:maxIdle>8</sql:maxIdle>
<sql:minIdle>0</sql:minIdle>
<sql:maxWait>-1</sql:maxWait>
<sql:timeBetweenEvictionRunsMillis>-1</sql:timeBetweenEvictionRunsMillis>
<sql:metadata>true</sql:metadata>
h3. CDK parameters defining service provider implementation
The following parameters correspond to the CDK configuration of the service provider implementation.

</jbi:provides>
</jbi:services>
</jbi:jbi>
{code}
{include:0 CDK SU Provide Configuration 5.8.0}

{include:0 CDK SU Provide Configuration 5.7.0}
\\
{center}{*}Configuration of a Service Unit to provide a service (SQL)*{center}
h3. CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.

{table-plus}
{include:0 CDK SU Interceptor configuration 5.8.0}

h3. Dedicated configuration
The following parameters correspond to the component specific configuration of the service provider implementation.

{table-plus}
|| Parameter || Description || Default || Required ||
| url | The JDBC URL of the target database | {center}\-{center} | {center}Yes{center} |
{table-plus}

{include:0 CDK SU Interceptor configuration}
h3. Service unit content

h3. Service Unit content
The service unit has to contain the following elements, packaged in the archive:
* the META-INF/jbi.xml descriptor file as described above,
* it is also highly recommended to provide a WSDL description for service provider embeded in the service-unit. The service provider contract must implement the interface "\{http://petals.ow2.org/components/sql/version-1}SQLInterface" defined in the abstract WSDL 'SQLInterface.wsdl' available as resource in the component archive.

The Service Unit has to contain the following elements, packaged in an archive:
* The META-INF/jbi.xml descriptor file, has described above
{code}
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
- service.wsdl (optional)
{code}

h1. Component Configuration
{note}Caution: The component requires JDBC Shared Library to communicate with databases. Please install first a valid Shared Library containing your database JDBC driver. Then you can configure your component by using PETALS Maven plugin with the goal {{jbi:configure}} or the PETALS Ant task {{petals-configure-component}}.{note}
h3. Example

{include:0 CDK Component Configuration Table 5.6.0}
{include:0 CDK Parameter scope}
{include:0 CDK Component Interceptor configuration}
An example of a Service Unit descriptor to provide an SQL service:
{code:lang=xml}
<jbi:jbi version="1.0"
xmlns:interfaceNs="http://petals.ow2.org/components/sql/version-1"
xmlns:serviceNs="http://test"

xmlns:sql="http://petals.ow2.org/components/sql/version-1"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<jbi:services binding-component="true">
<jbi:provides
interface-name="interfaceNs:SQLInterface"
service-name="serviceNs:MyDatabaseSQLService"
endpoint-name="MyDatabaseSQLServiceEndpoint">
<petalsCDK:wsdl>SQLService.wsdl</petalsCDK:wsdl>

<sql:url>jdbc:mysql://host_name:port/dbname</sql:url>
<sql:user>test</sql:user>
<sql:password>test</sql:password>
<sql:maxActive>8</sql:maxActive>
<sql:maxIdle>8</sql:maxIdle>
<sql:minIdle>0</sql:minIdle>
<sql:maxWait>-1</sql:maxWait>
<sql:timeBetweenEvictionRunsMillis>-1</sql:timeBetweenEvictionRunsMillis>
<sql:metadata>true</sql:metadata>
</jbi:provides>
</jbi:services>
</jbi:jbi>
{code}

h1. Configuring the component

The component can be configured through the parameters of its JBI descriptor file. These parameters are divided in following groups:
* *JBI parameters* that have not to be changed otherwise the component will not work,
* *CDK parameters* that are parameters driving the processing of the CDK layer,
* *Dedicated parameters* that are parameters specific to this component.

{note}Caution: The component requires the right JDBC Shared Libraries to communicate with your databases. Please install first valid Shared Libraries containing your database JDBC drivers. Then you can configure your component by using PETALS Maven plugin with the goal {{jbi:configure}} or the PETALS Ant task {{petals-configure-component}}.{note}

h2. CDK parameters
The component configuration includes the configuration of the CDK. The following parameters correspond to the CDK configuration.

{include:0 CDK Component Configuration Table 5.8.0}

h2. Interception configuration
{include:0 CDK Component Interceptor configuration 5.8.0}

h2. Dedicated configuration

No dedicated configuration parameter is available.

h1. Business monitoring

h3. Common metrics

{include:0 CDK Component Monitoring Metrics 5.68.0}

h3. Dedicated metrics