Petals-BC-Gateway 1.2.0+

Version 1 by Christophe DENEUX
on Mar 25, 2022 11:53.

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

Changes (62)

View Page History
{code}

h1. Service Rewriting

h1. Service Unit Configuration

h2. Consumes SU

In a Consumes SU, one must declare at least one '{{consumer-domain}}' and some '{{consumes}}' element to determine the services to be propagated to one or several of these consumer domains.

The '{{consumes}}' element can't override each other for the same '{{consumer-domain}}':
* If there is a '{{consumes}}' of type {{Interface:Service:endpoint}}, then there can't be another '{{consumes}}' of type {{Interface:Service:endpoint}}, {{Interface:Service:}} or {{Interface::}} defined for the same {{consumer-domain}}.
* If there is a '{{consumes}}' of type {{Interface:Service:}}, then there can't be another '{{consumes}}' of type {{Interface:Service:}} or {{Interface::}} defined for the same '{{consumer-domain}}'.
* If there is a '{{consumes}}' of type {{Interface::}}, then there can't be another '{{consumes}}' of type {{Interface::}} defined for the same '{{consumer-domain}}'.

h3. Consumer Domain Element
h2. Configuration

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 consumer implementation at CDK layer,
* *CDK interceptor parameters* that are parameters driving interceptors at CDK layer,
* *Dedicated parameters* that are parameters driving the service consumer implementation at component layer:
** Defining the provider domain linked to the current consumer domain.

h3. CDK parameters defining service consumer implementation
The following parameters correspond to the CDK configuration of the service consumer implementation.

{include:0 CDK SU BC Consume Configuration 5.8.0}

h3. CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.

{include:0 CDK SU Interceptor configuration 5.8.0}

h3. Dedicated configuration

h4. Definition of the provider domain linked to the current consumer domain

A consumer domain is defined through a sub-element '{{consumer-domain}}' under the JBI element'{{services}}.

{center}{*}Configuration of a {{consumer-domain}} element *{center}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter or +Attribute+ || Description || Default || Required ||
| +id+ | A unique name (in the SU) to identify this consumer domain configuration | \- | Yes |
| +transport+ | The identifier of a transport listener configured in the component | \- | Yes |
| auth-name | A unique name (in the transport listener) to be shared with the consumer domain that will connect to this SU | \- | Yes |
| remote-certificate | The path to a shared SSL certificate used to authenticate the consumer domain that will connect to this SU (relative path means in the SU, absolute path means on the filesystem) | \- | No |
| certificate | The path to a shared SSL certificate used to secure the connections (relative path means in the SU, absolute path means on the filesystem) | \- | Yes if {{remote-certificate}} is specified |
| key | The path to a private SSL key for the SSL certificate specified with {{certificate}} (relative path means in the SU, absolute path means on the filesystem) | \- | Yes if {{certificate}} is specified, else ignored |
| passphrase | The passphrase to unlock the SSL key specified with {{key}} | \- | Only if {{key}} is specified and needs a passphrase, else ignored |
| +propagation-polling-max-delay+ | The maximum delay between polling done by this SU to check new or removed endpoints in the domain (a 0 or negative value means no polling) in milliseconds| {{5000}} | Yes |
| +propagation-polling-acceleration+ | The polling starts at 5sec and is multiplied by this factor after each polling until the maximum delay is attained (a value equals to 1 or less means no acceleration, i.e., the delay is always at the configured maximum) | 2.0 | Yes |
{table-plus}
|| +Attribute+ or element || Description || Default value || Required || Support of placeholders ||
| +id+ | A unique name (in the SU) to identify this consumer domain configuration | \- | Yes | Yes |
| +transport+ | The identifier of a transport listener configured in the component | \- | Yes | Yes |
| auth-name | A unique name (in the transport listener) to be shared with the consumer domain that will connect to this SU | \- | Yes | Yes |
| remote-certificate | The path to a shared SSL certificate used to authenticate the consumer domain that will connect to this SU (relative path means in the SU, absolute path means on the filesystem) | \- | No | Yes |
| certificate | The path to a shared SSL certificate used to secure the connections (relative path means in the SU, absolute path means on the filesystem) | \- | Yes if {{remote-certificate}} is specified | Yes |
| key | The path to a private SSL key for the SSL certificate specified with {{certificate}} (relative path means in the SU, absolute path means on the filesystem) | \- | Yes if {{certificate}} is specified, else ignored | Yes |
| passphrase | The passphrase to unlock the SSL key specified with {{key}} | \- | Only if {{key}} is specified and needs a passphrase, else ignored | Yes |
| +propagation-polling-max-delay+ | The maximum delay between polling done by this SU to check new or removed endpoints in the domain (a 0 or negative value means no polling) in milliseconds| {{5000}} | Yes | Yes |
| +propagation-polling-acceleration+ | The polling starts at 5sec and is multiplied by this factor after each polling until the maximum delay is attained (a value equals to 1 or less means no acceleration, i.e., the delay is always at the configured maximum) | 2.0 | Yes | Yes |
{table-plus}

{tip}The elements defined inside {{consumer-domain}} in an SU accept placeholder values.{tip}
h4. Service consumer
To link a service consumer to an external service proBy default all service providers are exported with their current names to all consumer domains. You can select which service provider is exported in a given provider domain, evantually rewriting its names. Please use the following parameters of the element '{{provides}}':

h3. Consumes Element
{table-plus}
|| Element || Description || Default value || Required || Support of placeholders ||
| consumer | The identifier of a {{consumer-domain}} element specified in the SU | Yes (and more than once) | No |
{table-plus}

Note that in {{consumes}} elements for the Gateway BC, it has no meaning to specify a {{mep}} or an {{operation}}: they will be ignored, thus it is recommended to always set the {{mep}} to {{nil}} (because it is required to specify it):
{code}

{include:0 CDK SU Consume Configuration 5.7.0}
h1. Provides SU

{center}{*}BC Gateway configuration of a {{consumes}} element*{center}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter || Description || Default || Required ||
| consumer | The identifier of a {{consumer-domain}} element specified in the SU | Yes (and more than once) |
{table-plus}
In a Provides SU, one must declare at least one {{provider-domain}} and optionally some {{provides}} element to determine how the services are being propagated from one of the provider domains.

h2. Provides SU
The '{{provides}}' element must have a '{{provider}}' element and these can't override each other for the same '{{provider-domain}}':
* If there is a '{{provides}}' with a '{{provider}}' of type {{Interface:Service:endpoint}}, then there can't be another '{{provides}}' with a '{{provider}}' of type {{Interface:Service:endpoint}} or {{Interface:Service:}} defined for the same '{{provider-domain}}'.
* If there is a '{{provides}}' with a '{{provider}}' of type {{Interface:Service:}}, then there can't be another '{{provides}}' with a '{{provider}}' of type {{Interface:Service:}} defined for the same '{{provider-domain}}'.

In a Provides SU, one must declare at least one {{provider-domain}} and optionally some {{provides}} element to determine how the services are being propagated from one of the provider domain.
h2. Configuration

The {{provides}} element must have a {{provider}} element and these can't override each other for the same {{provider-domain}}:
* If there is a {{provides}} with a {{provider}} of type {{Interface:Service:endpoint}}, then there can't be another {{provides}} with a {{provider}} of type {{Interface:Service:endpoint}} or {{Interface:Service:}} defined for the same {{provider-domain}}.
* If there is a {{provides}} with a {{provider}} of type {{Interface:Service:}}, then there can't be another {{provides}} with a {{provider}} of type {{Interface:Service:}} defined for the same {{provider-domain}}.
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 consumer implementation at CDK layer,
* *CDK interceptor parameters* that are parameters driving interceptors at CDK layer,
* *Dedicated parameters* that are parameters driving the service consumer implementation at component layer:
** Defining the provider domain,
** Defining the service providers exported.

h3. Provider Domain Element
h3. CDK parameters defining service consumer implementation
The following parameters correspond to the CDK configuration of the service consumer implementation.

{center}{*}Configuration of a {{provider-domain}} element*{center}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter || Description || Default || Required ||
| +id+ | A unique name (in the SU) to identify this provider domain configuration | \- | Yes |
| remote-ip | The ip or hostname of the remote provider domain gateway | \- | Yes |
| remote-port | The port of the remote provider domain gateway | {{7500}} | Yes |
| remote-auth-name | A name to be shared with the provider domain that this SU will connect to | \- | Yes |
| certificate | The path to a shared SSL certificate used to authenticate me (relative path means in the SU, absolute path means on the filesystem) | \- | No |
| key | The path to a private SSL key for the SSL certificate specified with {{certificate}} (relative path means in the SU, absolute path means on the filesystem) | \- | Yes if {{certificate}} is specified, else ignored |
| passphrase | The passphrase to unlock the SSL key specified with {{key}} | \- | Yes if {{key}} is specified and needs a passphrase, else ignored |
| remote-certificate | The path to a shared SSL certificate used to authenticate the provider domain that this SU will connect to (relative path means in the SU, absolute path means on the filesystem) | \- | Yes if {{certificate}} is specified |
| +propagate-all+ | Set to {{false}} to propagate only the services declared as {{provides}} in the SU | {{true}} | Yes |
| +retry-delay+ | Delay between retry in case of disconnection in milliseconds | {{5000}} | Yes |
| +retry-max+ | Maximum retries before failing to connect (a negative value means infinite) | {{-1}} | Yes |
{table-plus}
{include:0 CDK SU BC Consume Configuration 5.8.0}

{tip}The elements defined inside {{provider-domain}} in an SU accept placeholder values.{tip}
h3. CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.

h3. Provides Element
{include:0 CDK SU Interceptor configuration 5.8.0}

{include:0 CDK SU Provide Configuration 5.7.0}
h3. Dedicated configuration

{center}{*}BC Gateway configuration of a {{provides}} element*{center}
h4. Provider domain definition
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter || Description || Default || Required ||
| provider | See below | \- | Yes |
A provider domain is defined through a sub-element '{{provider-domain}}' under the JBI element'{{services}}.

{center}{*}Configuration of a {{provider-domain}} element*{center}
{table-plus}
|| +Attribute+ or element || Description || Default value || Required || Support of placeholders ||
| +id+ | A unique name (in the SU) to identify this provider domain configuration | \- | Yes | Yes |
| remote-ip | The ip or hostname of the remote provider domain gateway | \- | Yes | Yes |
| remote-port | The port of the remote provider domain gateway | {{7500}} | Yes | Yes |
| remote-auth-name | A name to be shared with the provider domain that this SU will connect to | \- | Yes | Yes |
| certificate | The path to a shared SSL certificate used to authenticate me (relative path means in the SU, absolute path means on the filesystem) | \- | No | Yes |
| key | The path to a private SSL key for the SSL certificate specified with {{certificate}} (relative path means in the SU, absolute path means on the filesystem) | \- | Yes if {{certificate}} is specified, else ignored | Yes |
| passphrase | The passphrase to unlock the SSL key specified with {{key}} | \- | Yes if {{key}} is specified and needs a passphrase, else ignored | Yes |
| remote-certificate | The path to a shared SSL certificate used to authenticate the provider domain that this SU will connect to (relative path means in the SU, absolute path means on the filesystem) | \- | Yes if {{certificate}} is specified | Yes |
| +propagate-all+ | Set to {{false}} to propagate only the services declared as {{provides}} in the SU | {{true}} | Yes | Yes |
| +retry-delay+ | Delay between retry in case of disconnection in milliseconds | {{5000}} | Yes | Yes |
| +retry-max+ | Maximum retries before failing to connect (a negative value means infinite) | {{-1}} | Yes | Yes |
{table-plus}

{center}{*}Configuration of the {{provides}}'s {{provider}} element*{center}
h4. Service provider export
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter or +Attribute+ || Description || Default || Required ||
| +domain+ | The identifier of a {{provider-domain}} element specified in the SU | \- | Yes |
| provider-interface-name | The interface name of a service propagated by the provider domain that this SU will connect to (can be the same as the {{provides}}'s) | \- | Yes |
| provider-service-name | The service name of a service propagated by the provider domain that this SU will connect to (can be the same as the {{provides}}'s) | \- | Yes |
| provider-endpoint-name | The endpoint name of a service propagated by the provider domain that this SU will connect to | \- | No |
By default all service providers are exported with their current names to all consumer domains. You can select which service provider is exported in a given provider domain, evantually rewriting its names. Please use the following parameters of the element '{{provides}}':

{table-plus}
|| +Attribute+ or element || Description || Default value || Required || Support of placeholders ||
| +domain+ | The identifier of a {{provider-domain}} element specified in the SU | \- | Yes | No |
| provider-interface-name | The interface name of a service propagated by the provider domain that this SU will connect to (can be the same as the {{provides}}'s) | \- | Yes | No |
| provider-service-name | The service name of a service propagated by the provider domain that this SU will connect to (can be the same as the {{provides}}'s) | \- | Yes | No |
| provider-endpoint-name | The endpoint name of a service propagated by the provider domain that this SU will connect to | \- | No | No |
{table-plus}

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.

{code}
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
{code}

h3. Example

{code:xml}
<jbi:jbi version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:cdk="http://petals.ow2.org/components/extensions/version-5" xmlns:jg="http://petals.ow2.org/components/petals-bc-gateway/version-1.0"
xmlns:hello="http://petals.ow2.org">

<jbi:services binding-component="true">

<jg:provider-domain id="gw-domain-1-0">
<jg:remote-auth-name>${domain.1.gateway.secret}</jg:remote-auth-name>
<jg:remote-ip>${domain.1.0.gateway.host}</jg:remote-ip>
<jg:remote-port>${domain.1.0.gateway.port}</jg:remote-port>
</jg:provider-domain>

<jg:provider-domain id="gw-domain-1-1">
<jg:remote-auth-name>${domain.1.gateway.secret}</jg:remote-auth-name>
<jg:remote-ip>${domain.1.1.gateway.host}</jg:remote-ip>
<jg:remote-port>${domain.1.1.gateway.port}</jg:remote-port>
</jg:provider-domain>

</jbi:services>
</jbi:jbi>
{code}

{anchor:component-configuration}
h1. Component Configuration
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,
* and parameters dedicated to the Gateway part:
** consumer domain,
** provider domain.

{code:lang=xml}
<jbi:jbi xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:jbi="http://java.sun.com/xml/ns/jbi" version="1.0"
xmlns:rest="http://petals.ow2.org/components/rest/version-1">

<jbi:component type="binding-component">
...
<petalsCDK:acceptor-pool-size />
<petalsCDK:acceptor-retry-number />
<petalsCDK:acceptor-retry-wait />
<petalsCDK:acceptor-stop-max-wait />
<petalsCDK:processor-pool-size />
<petalsCDK:processor-max-pool-size />
<petalsCDK:processor-keep-alive-time />
<petalsCDK:processor-stop-max-wait />
<petalsCDK:time-beetween-async-cleaner-runs />
<petalsCDK:properties-file />
<petalsCDK:monitoring-sampling-period />
<petalsCDK:activate-flow-tracing />
<petalsCDK:propagate-flow-tracing-activation />
...
<g:consumer-domains-max-pool-size />
<g:provider-domains-max-pool-size />
...
</jbi:component>
</jbi:jbi>
{code}

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.68.0}

{info}Note that the parameters {{processor-pool-size}} and {{processor-max-pool-size}} defaults respectively to {{1}} and {{6}} in the Gateway BC.{info}

{center}{*}Configuration of the component, Gateway part*{center}
h2. Interception configuration
{include:0 CDK Component Interceptor configuration 5.8.0}
{table-plus:columnAttributes=,,style="text-align:center;",style="text-align:center;"}
|| Parameter || Description || Default || Required || Scope ||
| consumer-domains-max-pool-size | Max number of threads used for handling incoming consumer partner connections: while each incoming consumer partner connection handles one exchange at a time, this limits the number of concurrent exchange processing amongst all incoming connection | 6 | No | Installation |
h2. Dedicated configuration

These parameters drive features proposed by the component and configure the Gateway part:
* consumer domain,
* provider domain.

h3. Parameters of the consumer domain part
{table-plus}
|| {color:#333333}Parameter{color} || {color:#333333}Description{color} || {color:#333333}Default{color} || {color:#333333}Required{color} || Scope ||
| provider-domains-max-pool-size | Max number of threads used for handling outgoing provider partner connections: while each outgoing provider partner connection handles one exchange at a time, this limits the number of concurrent exchange processing amongst all outgoing connection | 6 | No | Installation |
{table-plus}

{include:0 CDK Parameter scope}
h3. Parameters of the provider domain part
{table-plus}
|| {color:#333333}Parameter{color} || {color:#333333}Description{color} || {color:#333333}Default{color} || {color:#333333}Required{color} || Scope ||
| consumer-domains-max-pool-size | Max number of threads used for handling incoming consumer partner connections: while each incoming consumer partner connection handles one exchange at a time, this limits the number of concurrent exchange processing amongst all incoming connection | 6 | No | Installation |
{table-plus}

h1. Logging
h3. Common metrics

{include:0 CDK Component Monitoring Metrics 5.68.0}

h3. Dedicated metrics