Provide a HTTP(S)/SOAP web-service access in the ESB
In provide mode, the component exposes an external Web Service in the JBI environment to send SOAP requests to the external Web Service.
The HTTPS configuration is located at the service-unit level to be able to use different certificates with different external webservices. |
Only JKS keystore and truststore are supported in the HTTPS mode. Moreover, the key password and the keystore passwords have to be the same. |
Usage
The SOAP component can expose an external web-ervice as a JBI service endpoint by deploying a Service Unit on it:
When a message is received on a SOAP linked endpoint from the JBI environment, it is transformed into a SOAP message and sent to the Web Service. The address of the Web Service to send the SOAP message to is defined in the address extension of the deployed Service Unit.
The SOAP message is created like this:
- The JBI message payload is wrapped in the SOAP body
- The JBI message attachments are used to create SOAP ones
- The JBI message exchange operation is used to create the SOAP action
- The JBI MEP is used to determine the SOAP MEP
The external web-service is called and the SOAP response is processed and returned to the JBI environment.
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 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.
CDK parameters defining service provider implementation
The following parameters correspond to the CDK configuration of the service provider implementation.
The service provider is defined into the section 'provides' of the JBI descriptor, containing:
Parameter
|
Description
|
Default
|
Required
|
Support placeholders
|
---|---|---|---|---|
interface-name
|
Interface name of the service provider. Must match the one defined in the WSDL. | -
|
Yes
|
No
|
service-name
|
Service name of the service provider. Must match the one defined in the WSDL. | -
|
Yes
|
No
|
endpoint-name
|
Endpoint name of the service provider. Must match the one defined in the WSDL. The value 'autogenerate' will force Petals ESB to generate an endpoint name as UUID at deployment time. | -
|
Yes
|
No
|
timeout
|
Timeout in milliseconds of a synchronous send. This parameter is used by the method sendSync(Exchange exchange) proposes by the CDK Listeners classes. Set it to 0 for an infinite timeout. |
30000
|
No
|
Yes
|
su-interceptors
|
Service unit interceptor configuration. See Service unit interceptor configuration. | -
|
No
|
No
|
exchange-properties
|
This sections defines the list of properties to set to the JBI exchange when processing a service. | -
|
No
|
No
|
message-properties
|
This sections defines the list of properties to set to the JBI message when processing a service. | -
|
No
|
No
|
validate-wsdl
|
Activate the validation of the WSDL when deploying a service unit. | true
|
No
|
No
|
forward-security-subject
|
Defines if the security subject will be forwarded from IN message to OUT message. | false
|
No
|
No
|
forward-message-properties
|
Defines if the message properties will be forwarded from IN message to OUT message. | false
|
No
|
No
|
forward-attachments
|
Defines if attachment will be forwarded from IN message to OUT message. | false
|
No
|
No
|
activate-flow-tracing
|
Enable ('true') or disable ('false') the flow tracing for this service provider. This value overrides the value defined at component level and can be overridden at incoming exchange level. | Value defined at component
|
No
|
Yes
|
wsdl
|
Path to the WSDL document describing services and operations exposed by the provided JBI endpoints defined in the SU. The value of this parameter is :
|
-
|
Yes
|
No
|
When an HTTP connection is established with the external service provider, the connection timeout and the socket read timeout are defined with the value of the parameter 'timeout'. |
CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.
Interceptors can be defined to inject some post or pre-processing in the service provider processing or service consumer processing.
Using interceptor is very sensitive and must be manipulated only by power users. A non properly coded interceptor engaged in a component can lead to uncontrolled behaviors, out of the standard process.
Example of an interceptor configuration:
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"> <jbi:services> <jbi:provides|consumes> <!--...--> <petalsCDK:su-interceptors> <petalsCDK:send> <petalsCDK:interceptor name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> <petalsCDK:param name="myParamName2">myParamValue2</petalsCDK:param> </petalsCDK:interceptor> </petalsCDK:send> <petalsCDK:accept> <petalsCDK:interceptor name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> </petalsCDK:interceptor> </petalsCDK:accept> <petalsCDK:send-response> <petalsCDK:Interceptor name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> </petalsCDK:Interceptor> </petalsCDK:send-response> <petalsCDK:accept-response> <petalsCDK:Interceptor name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> </petalsCDK:Interceptor> </petalsCDK:accept-response> </petalsCDK:su-interceptors> <!--...--> </jbi:provides|consumes> <!--...--> </jbi:services> </jbi:jbi>
Interceptors configuration for SU (CDK)
Parameter | Description | Default | Required |
---|---|---|---|
send | Interceptor dedicated to send phase, for an exchange sent by a consumer | - | No |
accept | Interceptor dedicated to receive phase, for an exchange received by a provider | - | No |
send-response | Interceptor dedicated to send phase, for an exchange (a response) received by a consumer | - | No |
accept-response | Interceptor dedicated to receive phase, for an exchange sent (a response) by a provider | - | No |
interceptor - name | Logical name of the interceptor instance defined at component level, see CDK Component Interceptor configuration. | - | Yes |
param[] - name | The name of the parameter to use for the interceptor for this SU | - | No |
param[] | The value of the parameter to use for the interceptor for this SU | - | No |
Dedicated configuration
The following parameters correspond to the component specific configuration of the service provider implementation.
Parameter | Description | Default | Required | ||
---|---|---|---|---|---|
soap-version | The SOAP version used to create SOAP messages. Possible values are 1.1 and 1.2. | 1.1 | Yes | ||
address | Address of the external Web Service to send JBI messages to. This parameter supports place holders reloading | - | Yes | ||
chunked-mode | Activate the HTTP chunked mode on Web Service calls. Possible values are: true, false. | false | Yes | ||
mode | The mode to be used to send SOAP message to the specified address. Possible values are: SOAP for basic Web Service calls, JSON for JSON service calls and REST for REST service calls. | SOAP | Yes | ||
enable-compatibility-for | Enable the compatibility with a specified Web Service stack. Possible values are: AXIS1 for Axis1 Web Service stack. |
- | No | ||
enable-wsa | Enable the WSA-Addressing. Set the WSA headers in the outcoming SOAP messages. Possible values are: true, false. | false |
No |
||
proxy-host | The proxy host name. If it is not set, the proxy mode will be disabled and all others proxy parameters are ignored. | - | No | ||
proxy-port | The proxy host port | - | No | ||
proxy-user | The proxy user | - | No | ||
proxy-password | The proxy password | - | No | ||
proxy-domain | The proxy domain | - | No | ||
https-truststore-file | The file path of the truststore file. | - | No |
||
https-truststore-password | The password of the truststore. | - | No | ||
https-keystore-file | The file path of the keystore file. | - | No | ||
https-keystore-password | The password of the keystore
|
- | No | ||
http-basic-auth-username | the username for HTTP Basic authentication. | - | No | ||
http-basic-auth-password | the password for HTTP Basic authentication. | - | No | ||
modules | A list of Axis2 modules names to engage (separated by comas). | - | No |
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,
- an optional WS-Policy file,
- an optional JAR file containing a password callback, quoted in the WS-Policy
service-unit.zip + META-INF - jbi.xml (as defined above) - service.wsdl (recommended) - wss-policy.xml (optional) - pwdcallback.jar (optional)
Examples
Basic HTTP/SOAP web-service
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi version="1.0" xmlns:generatedNs="http://petals.ow2.org/" xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:soap="http://petals.ow2.org/components/soap/version-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <jbi:services binding-component="true"> <jbi:provides interface-name="generatedNs:IntegrationService" service-name="generatedNs:IntegrationService" endpoint-name="IntegrationServiceSOAP"> <petalsCDK:timeout>1000</petalsCDK:timeout> <petalsCDK:wsdl>IntegrationService.wsdl</petalsCDK:wsdl> <soap:address>http://localhost:8088/mockIntegrationServiceSOAP</soap:address> <soap:soap-version>1.1</soap:soap-version> <soap:chunked-mode>false</soap:chunked-mode> <soap:mode>SOAP</soap:mode> </jbi:provides> </jbi:services> </jbi:jbi>
Basic HTTPS/SOAP web-service
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi version="1.0" xmlns:generatedNs="http://petals.ow2.org/" xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:soap="http://petals.ow2.org/components/soap/version-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <jbi:services binding-component="true"> <jbi:provides interface-name="generatedNs:IntegrationService" service-name="generatedNs:IntegrationService" endpoint-name="IntegrationServiceSOAP"> <petalsCDK:timeout>1000</petalsCDK:timeout> <petalsCDK:wsdl>IntegrationService.wsdl</petalsCDK:wsdl> <soap:address>https://localhost:8088/mockIntegrationServiceSOAP</soap:address> <soap:soap-version>1.1</soap:soap-version> <soap:chunked-mode>false</soap:chunked-mode> <soap:mode>SOAP</soap:mode> <soap:https-truststore-file>../https/clientTruststore.jks</soap:https-truststore-file> <soap:https-truststore-password>passwordClientTruststore</soap:https-truststore-password> <soap:https-keystore-file>../https/clientKeystore.jks</soap:https-keystore-file> <soap:https-keystore-password>passwordClientKeystore</soap:https-keystore-password> </jbi:provides> </jbi:services> </jbi:jbi>
HTTP/SOAP web-service with WS-Security
An example of a Service Unit descriptor that provides a Web Service with Timestamp, Signature and Encryption:
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi version="1.0" xmlns:generatedNs="http://petals.ow2.org/test/" xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:soap="http://petals.ow2.org/components/soap/version-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <jbi:services binding-component="true"> <jbi:provides interface-name="generatedNs:TestServiceAxisWSS" service-name="generatedNs:TestServiceAxisWSS" endpoint-name="TestServiceAxisWSSSOAP"> <petalsCDK:timeout>30000</petalsCDK:timeout> <petalsCDK:wsdl>TestServiceAxisWSS.wsdl</petalsCDK:wsdl> <soap:address>http://192.168.1.161:8080/axis2/services/TestServiceAxisWSS/</soap:address> <soap:soap-version>1.1</soap:soap-version> <soap:chunked-mode>false</soap:chunked-mode> <soap:mode>SOAP</soap:mode> <soap:modules>rampart</soap:modules> <soap:wss-policy>wss-policy.xml</soap:wss-policy> </jbi:provides> </jbi:services> </jbi:jbi>
with the WS-Policy defined as following into the file wss-policy.xml, completed with the Rampart configuration:
<wsp:Policy wsu:Id="UTOverTransport" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"> <wsp:ExactlyOne> <wsp:All> <sp:SignedSupportingTokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"> <wsp:Policy> <sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient"> <wsp:Policy> <sp:HashPassword /> </wsp:Policy> </sp:UsernameToken> </wsp:Policy> </sp:SignedSupportingTokens> <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> <ramp:user>user</ramp:user> <ramp:passwordCallbackClass>org.ow2.petals.binding.soap.test.UTConsumeCBHandler</ramp:passwordCallbackClass> </ramp:RampartConfig> </wsp:All> </wsp:ExactlyOne> </wsp:Policy>
Exposing an internal JBI service endpoint
In consumer mode, the component exposes an internal JBI service outside the bus to transfer incoming SOAP requests to the internal service.
Usage
The Petals BC SOAP can listen incoming SOAP messages and send messages to a JBI service endpoint by deploying a Service Unit on it. The component consumes the JBI service through HTTP(S) and JMS:
- consumes a JBI service on a HTTP(S)/SOAP message:
- consumes a JBI service on JMS message (containing SOAP envelope)
When a SOAP message is handled by the component, it is transformed into a JBI Message and sent to the JBI service endpoint configured in the Service Unit. The JBI message is created like this:
- The JBI operation is resolved (see Operation Resolving).
- Copy the SOAP body into the JBI one.
- Put the SOAP attachments into JBI ones.
- Put the SOAP headers into the protocol header JBI message property.
As a web-service SOAP over HTTP(S)
The HTTPS configuration is located at the component level because only one certificat is needed to expose the Petals service as a HTTPS web-service. |
By default, the component is configured to handle URI with the pattern: http://localhost:8084/petals/services/<service-name> (or 8083 for HTTPS). This URI can be configured at component configuration level, see SOAP component configuration). It also handles "?wsdl" calls, the WSDL description is retrieved from the endpoint and sent back to the consumer.
By default, the list of HTTP services is available at http://localhost:8084/petals/services/listServices (or 8083 for HTTPS) URI. It can also be configured at component configuration level.
The HTTPS transport is activated at component configuration level.
If you plan tests with JAX-WS Reference Implementation, please use the JDK one (not the JRE one), otherwise MTOM attachments will not be handled properly. |
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.
CDK parameters defining service consumer implementation
The following parameters correspond to the CDK configuration of the service consumer implementation.
A service consumer is defined into the section 'consumes' of the JBI descriptor, containing:
Parameter
|
Description
|
Default
|
Required
|
Support placeholders
|
---|---|---|---|---|
interface-name
|
Interface name of the service provider to invoke. | -
|
Yes
|
No
|
service-name
|
Service name of the service provider to invoke. | -
|
No
|
No
|
endpoint-name
|
Endpoint name of the service provider to invoke. | -
|
No
|
No
|
timeout
|
Timeout in milliseconds of a synchronous send. This parameter can be used in conjunction with the sendSync(Exchange exchange) method of the Listeners. Set 0 for an infinite timeout. | 30000 | No
|
Yes
|
operation
|
Operation to call on the service provider. If no operation is specified in the Message Exchange to send, this parameter will be used. | -
|
No
|
No
|
activate-flow-tracing
|
Enable ('true') or disable ('false') the flow tracing for this service consumer. This value overrides the value defined at component level and can be overridden at incoming exchange level. | Value defined at component level | No
|
Yes
|
propagate-flow-tracing-activation
|
Control whether the flow tracing activation state must be propagated to next flow steps or not. If 'true', the flow tracing activation state is propagated to the invoked service provider. This value overrides the value defined at component level. | Value defined at component | No
|
Yes
|
su-interceptors
|
Service unit interceptor configuration. See Service unit interceptor configuration. | -
|
No
|
No
|
mep
|
Message exchange pattern to use. | -
|
Yes
|
No
|
The configuration of the flow tracing (ie. value of parameter 'activate-flow-tracing') can be overridden on HTTP(S) web-service invocation setting the HTTP header 'org.ow2.petals.monitoring.activate-flow-tracing':
|
CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.
Interceptors can be defined to inject some post or pre-processing in the service provider processing or service consumer processing.
Using interceptor is very sensitive and must be manipulated only by power users. A non properly coded interceptor engaged in a component can lead to uncontrolled behaviors, out of the standard process.
Example of an interceptor configuration:
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"> <jbi:services> <jbi:provides|consumes> <!--...--> <petalsCDK:su-interceptors> <petalsCDK:send> <petalsCDK:interceptor name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> <petalsCDK:param name="myParamName2">myParamValue2</petalsCDK:param> </petalsCDK:interceptor> </petalsCDK:send> <petalsCDK:accept> <petalsCDK:interceptor name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> </petalsCDK:interceptor> </petalsCDK:accept> <petalsCDK:send-response> <petalsCDK:Interceptor name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> </petalsCDK:Interceptor> </petalsCDK:send-response> <petalsCDK:accept-response> <petalsCDK:Interceptor name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> </petalsCDK:Interceptor> </petalsCDK:accept-response> </petalsCDK:su-interceptors> <!--...--> </jbi:provides|consumes> <!--...--> </jbi:services> </jbi:jbi>
Interceptors configuration for SU (CDK)
Parameter | Description | Default | Required |
---|---|---|---|
send | Interceptor dedicated to send phase, for an exchange sent by a consumer | - | No |
accept | Interceptor dedicated to receive phase, for an exchange received by a provider | - | No |
send-response | Interceptor dedicated to send phase, for an exchange (a response) received by a consumer | - | No |
accept-response | Interceptor dedicated to receive phase, for an exchange sent (a response) by a provider | - | No |
interceptor - name | Logical name of the interceptor instance defined at component level, see CDK Component Interceptor configuration. | - | Yes |
param[] - name | The name of the parameter to use for the interceptor for this SU | - | No |
param[] | The value of the parameter to use for the interceptor for this SU | - | No |
Dedicated configuration
Parameter | Description | Default | Required | ||
---|---|---|---|---|---|
service-name | Web-service name to expose. This value appears on URL used to expose the service. | - | Yes | ||
soap-action | The SOAP action QName to be used for the Web Service, will override the JBI message operation. | - | No | ||
mode | The mode to be used to receive messages. Possible values are: SOAP for basic Web Service messages, JSON for JSON service messages and REST for REST service messages. | SOAP | Yes | ||
enable-compatibility-for | Enable the compatibility with a specified Web Service stack. Possible values are: AXIS1 for Axis1 Web Service stack. | - | No | ||
enable-http-transport | Enable the HTTP transport layer to send or receive SOAP messages. Possible values are: true, false. | true | No | ||
enable-https-transport | Enable the HTTPS transport layer to send or receive SOAP messages. Possible values are: true, false. | false | No | ||
http-services-redirection | HTTP redirection alias(es) for exposed Web Service. | - | No | ||
address | Same as service-name.
|
- | No |
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
service-unit.zip + META-INF - jbi.xml (as defined above)
Example
An example of a service unit descriptor that exposes a web-service over HTTP:
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi version="1.0" xmlns:generatedNs="http://petals.ow2.org/" xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:soap="http://petals.ow2.org/components/soap/version-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <jbi:services binding-component="true"> <jbi:consumes interface-name="generatedNs:IntegrationService" service-name="generatedNs:IntegrationService" endpoint-name="IntegrationServiceSOAP"> <petalsCDK:timeout>500</petalsCDK:timeout> <petalsCDK:mep xsi:nil="true" /> <soap:address>IntegrationServiceSOAPByPetals</soap:address> <soap:mode>SOAP</soap:mode> <soap:enable-http-transport>true</soap:enable-http-transport> <soap:enable-jms-transport>false</soap:enable-jms-transport> </jbi:consumes> </jbi:services> </jbi:jbi>
As a web-service SOAP over JMS
The Petals BC SOAP can receive JMS messages from a JMS queue and send SOAP messages (contained in the JMS body message) to a JBI service endpoint by deploying a service unit on it. It enables to support the following scenario: a JMS publisher sends a message to a JMS server and the SOAP component consumes the JMS message which contains a SOAP envelope in its body.
When the service unit is started, a queue is created on the JMS server by the SOAP component if it does not exist. The name of the queue is the value of the parameter "service-name". When a message is sent to the JMS queue, it is received and treated by the SOAP component.
JMS server The JMS server must be started before starting the BC SOAP component (if the JMS transport layer is configured). |
JMS driver as shared library A shared library corresponding to the JMS server must be installed in Petals ESB before installing the BC SOAP component. |
Warning This feature is currently only supported in consumer mode with the operation with the MEP InOnly. |
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.
CDK parameters defining service consumer implementation
The following parameters correspond to the CDK configuration of the service consumer implementation.
A service consumer is defined into the section 'consumes' of the JBI descriptor, containing:
Parameter
|
Description
|
Default
|
Required
|
Support placeholders
|
---|---|---|---|---|
interface-name
|
Interface name of the service provider to invoke. | -
|
Yes
|
No
|
service-name
|
Service name of the service provider to invoke. | -
|
No
|
No
|
endpoint-name
|
Endpoint name of the service provider to invoke. | -
|
No
|
No
|
timeout
|
Timeout in milliseconds of a synchronous send. This parameter can be used in conjunction with the sendSync(Exchange exchange) method of the Listeners. Set 0 for an infinite timeout. | 30000 | No
|
Yes
|
operation
|
Operation to call on the service provider. If no operation is specified in the Message Exchange to send, this parameter will be used. | -
|
No
|
No
|
activate-flow-tracing
|
Enable ('true') or disable ('false') the flow tracing for this service consumer. This value overrides the value defined at component level and can be overridden at incoming exchange level. | Value defined at component level | No
|
Yes
|
propagate-flow-tracing-activation
|
Control whether the flow tracing activation state must be propagated to next flow steps or not. If 'true', the flow tracing activation state is propagated to the invoked service provider. This value overrides the value defined at component level. | Value defined at component | No
|
Yes
|
su-interceptors
|
Service unit interceptor configuration. See Service unit interceptor configuration. | -
|
No
|
No
|
mep
|
Message exchange pattern to use. | -
|
Yes
|
No
|
The configuration of the flow tracing (ie. value of parameter 'activate-flow-tracing') can be overridden on HTTP(S) web-service invocation setting the HTTP header 'org.ow2.petals.monitoring.activate-flow-tracing':
|
CDK parameters driving interceptors
The following parameters drive interceptors at CDK layer.
Interceptors can be defined to inject some post or pre-processing in the service provider processing or service consumer processing.
Using interceptor is very sensitive and must be manipulated only by power users. A non properly coded interceptor engaged in a component can lead to uncontrolled behaviors, out of the standard process.
Example of an interceptor configuration:
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"> <jbi:services> <jbi:provides|consumes> <!--...--> <petalsCDK:su-interceptors> <petalsCDK:send> <petalsCDK:interceptor name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> <petalsCDK:param name="myParamName2">myParamValue2</petalsCDK:param> </petalsCDK:interceptor> </petalsCDK:send> <petalsCDK:accept> <petalsCDK:interceptor name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> </petalsCDK:interceptor> </petalsCDK:accept> <petalsCDK:send-response> <petalsCDK:Interceptor name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> </petalsCDK:Interceptor> </petalsCDK:send-response> <petalsCDK:accept-response> <petalsCDK:Interceptor name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> </petalsCDK:Interceptor> </petalsCDK:accept-response> </petalsCDK:su-interceptors> <!--...--> </jbi:provides|consumes> <!--...--> </jbi:services> </jbi:jbi>
Interceptors configuration for SU (CDK)
Parameter | Description | Default | Required |
---|---|---|---|
send | Interceptor dedicated to send phase, for an exchange sent by a consumer | - | No |
accept | Interceptor dedicated to receive phase, for an exchange received by a provider | - | No |
send-response | Interceptor dedicated to send phase, for an exchange (a response) received by a consumer | - | No |
accept-response | Interceptor dedicated to receive phase, for an exchange sent (a response) by a provider | - | No |
interceptor - name | Logical name of the interceptor instance defined at component level, see CDK Component Interceptor configuration. | - | Yes |
param[] - name | The name of the parameter to use for the interceptor for this SU | - | No |
param[] | The value of the parameter to use for the interceptor for this SU | - | No |
Dedicated configuration
Parameter | Description | Default | Required | ||
---|---|---|---|---|---|
service-name | Web-service name to expose, used as JMS destination to listen. | - | Yes | ||
soap-action | The SOAP action QName to be used for the Web Service, will override the JBI message operation. | - | No | ||
mode | The mode to be used to receive messages. Possible values are: SOAP for basic Web Service messages, JSON for JSON service messages and REST for REST service messages. | SOAP | Yes | ||
enable-compatibility-for | Enable the compatibility with a specified Web Service stack. Possible values are: AXIS1 for Axis1 Web Service stack. | - | No | ||
enable-jms-transport | Enable the JMS transport layer to receive SOAP messages. Possible values are: true, false. | false | No | ||
http-services-redirection | HTTP redirection alias(es) for exposed Web Service. | - | No | ||
address | Same as service-name.
|
- | No |
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
service-unit.zip + META-INF - jbi.xml (as defined above)
Example
An example of a service unit descriptor that exposes a web-service over JMS:
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi version="1.0" xmlns:generatedNs="http://petals.ow2.org/" xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:soap="http://petals.ow2.org/components/soap/version-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <jbi:services binding-component="true"> <jbi:consumes interface-name="generatedNs:IntegrationService" service-name="generatedNs:IntegrationService" endpoint-name="IntegrationServiceSOAP"> <petalsCDK:timeout>500</petalsCDK:timeout> <petalsCDK:mep xsi:nil="true" /> <soap:address>IntegrationServiceSOAPByPetals</soap:address> <soap:mode>SOAP</soap:mode> <soap:enable-http-transport>false</soap:enable-http-transport> <soap:enable-jms-transport>true</soap:enable-jms-transport> </jbi:consumes> </jbi:services> </jbi:jbi>
As a Web Service with WS-Security
WS-Security is enabled engaging the module 'rampart' and providing a WS Policy file through parameters 'modules' and 'wss-policy'.
Configuration
Moreover the basic configuration to expose the internal endpoint as a HTTP(S)/SOAP or JMS/SOAP service, the following parameters exist to drive WS-Security:
Parameter | Description | Default | Required |
---|---|---|---|
modules | A list of Axis2 modules names to engage (separated by comas). Only Rampart (with value 'rampart') can be engaged to enable WS-Security | - | No |
wss-policy | The file describing the WS Policy to apply. | - | No |
Example of WS-Security based on UsernameToken
Service unit descriptor
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi version="1.0" xmlns:generatedNs="http://petals.ow2.org/" xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:soap="http://petals.ow2.org/components/soap/version-4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <jbi:services binding-component="true"> <jbi:consumes interface-name="generatedNs:IntegrationService" service-name="generatedNs:IntegrationService" endpoint-name="IntegrationServiceSOAP"> <petalsCDK:timeout>60000</petalsCDK:timeout> <petalsCDK:mep xsi:nil="true" /> <soap:address>IntegrationServiceSOAPByPetalsUsernameToken</soap:address> <soap:remove-root>false</soap:remove-root> <soap:mode>SOAP</soap:mode> <soap:enable-http-transport>true</soap:enable-http-transport> <soap:modules>rampart</soap:modules> <soap:wss-policy>wss-policy.xml</soap:wss-policy> </jbi:consumes> </jbi:services> </jbi:jbi>
with the WS-Policy defined as following into the file wss-policy.xml:
<wsp:Policy wsu:Id="UTOverTransport" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"> <wsp:ExactlyOne> <wsp:All> <sp:SignedSupportingTokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"> <wsp:Policy> <sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient"> <wsp:Policy> <sp:HashPassword /> </wsp:Policy> </sp:UsernameToken> </wsp:Policy> </sp:SignedSupportingTokens> <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> <ramp:passwordCallbackClass>org.ow2.petals.test.PWCBHandler</ramp:passwordCallbackClass> </ramp:RampartConfig> </wsp:All> </wsp:ExactlyOne> </wsp:Policy>
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
- the WS-Policy file described as above,
- and a JAR file containing a password callback, quoted in the WS-Policy file and necessary to check the user and the password of the token
service-unit.zip + META-INF - jbi.xml (as defined above) - wss-policy.xml (The WS Policy description) - pcwbhandler.jar (The password callback)
Example of WS-Security based on Timestamp, Signature and Encryption
Service unit descriptor
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi version="1.0" xmlns:generatedNs="http://petals.ow2.org/" xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:soap="http://petals.ow2.org/components/soap/version-5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <jbi:services binding-component="true"> <jbi:consumes interface-name="generatedNs:IntegrationService" service-name="generatedNs:IntegrationService" endpoint-name="IntegrationServiceSOAP"> <petalsCDK:timeout>60000</petalsCDK:timeout> <petalsCDK:mep xsi:nil="true" /> <soap:address>IntegrationServiceSOAPByPetalsChiffrementSignature</soap:address> <soap:remove-root>false</soap:remove-root> <soap:mode>SOAP</soap:mode> <soap:enable-http-transport>true</soap:enable-http-transport> <soap:modules>rampart</soap:modules> <soap:wss-policy>wss-policy.xml</soap:wss-policy> </jbi:consumes> </jbi:services> </jbi:jbi>
with the WS-Policy defined as following into the file wss-policy.xml:
<wsp:Policy wsu:Id="SigEncr" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"> <wsp:ExactlyOne> <wsp:All> <sp:SymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <wsp:Policy> <sp:ProtectionToken> <wsp:Policy> <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never"> <wsp:Policy> <!-- sp:RequireDerivedKeys /> <sp:RequireIssuerSerialReference /> <sp:RequireThumbprintReference /> <sp:WssX509V3Token10 /--> <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> <ramp:userCertAlias>signKey</ramp:userCertAlias> <ramp:encryptionUser>encryptKey</ramp:encryptionUser> </ramp:RampartConfig> </wsp:Policy> </sp:X509Token> </wsp:Policy> </sp:ProtectionToken> <sp:AlgorithmSuite> <wsp:Policy> <sp:Basic128 /> </wsp:Policy> </sp:AlgorithmSuite> <sp:Layout> <wsp:Policy> <sp:Strict /> </wsp:Policy> </sp:Layout> <sp:EncryptBeforeSigning /> <sp:OnlySignEntireHeadersAndBody /> </wsp:Policy> </sp:SymmetricBinding> <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <sp:Body /> </sp:SignedParts> <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <sp:Body /> </sp:EncryptedParts> <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> <ramp:userCertAlias>signKey</ramp:userCertAlias--> <ramp:encryptionUser>encryptKey</ramp:encryptionUser> <ramp:passwordCallbackClass>org.ow2.petals.test.PWCBHandler</ramp:passwordCallbackClass> <ramp:signatureCrypto> <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin"> <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property> <ramp:property name="org.apache.ws.security.crypto.merlin.file">serverKeystore.jks</ramp:property> <!-- Password of the keystore --> <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">serverKeystorePassword</ramp:property> </ramp:crypto> </ramp:signatureCrypto> <ramp:encryptionCypto> <ramp:crypto provider="org.apache.ws.security.components.crypto.Merlin"> <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.type">JKS</ramp:property> <ramp:property name="org.apache.ws.security.crypto.merlin.file">serverKeystore.jks</ramp:property> <!-- Password of the keystore --> <ramp:property name="org.apache.ws.security.crypto.merlin.keystore.password">serverKeystorePassword</ramp:property> </ramp:crypto> </ramp:encryptionCypto> </ramp:RampartConfig> </wsp:All> </wsp:ExactlyOne> </wsp:Policy>
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,
- the WS-Policy file described as above,
- a JAR file containing a password callback, quoted in the WS-Policy file and necessary to get the private key pair from the keystore to encrypt/decrypt the incoming and outgoing messages and to get the public/private key pair to sign the messages,
- the serverKeystore.jks keystore file, quoted in the WS-Policy and containing keys for encryption and signature.
service-unit.zip + META-INF - jbi.xml (as defined above) - wss-policy.xml (The WS Policy description) - pcwbhandler.jar (The password callback) - serverKeystore.jks (The key store)
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 embedded SOAP servers and clients:
- embedded HTTP server,
- embedded HTTP web-service clients,
- embedded JMS client listenning incoming messages.
CDK parameters
The component configuration includes the configuration of the CDK. The following parameters correspond to the CDK configuration.
Parameter | Description | Default | Scope* |
---|---|---|---|
acceptor-pool-size | The size of the thread pool used to accept Message Exchanges from the NMR. Once a message is accepted, its processing is delegated to the processor pool thread. | 1 |
Runtime |
acceptor-retry-number | Number of tries to submit a message exchange to a processor for processing before to declare that it cannot be processed. | 40 |
Installation |
acceptor-retry-wait | Base duration, in milliseconds, to wait between two processing submission tries. At each try, the new duration is the previous one plus this base duration. | 250 |
Installation |
acceptor-stop-max-wait | The max duration (in milliseconds) before, on component stop, each acceptor is stopped by force. | 500 |
Runtime |
processor-pool-size | The size of the thread pool used to process Message Exchanges. Once a message is accepted, its processing is delegated to one of the thread of this pool. | 10 | Runtime |
processor-max-pool-size | The maximum size of the thread pool used to process Message Exchanges. The difference between this size and the processor-pool-size represents the dynamic threads that can be created and destroyed during overhead processing time. |
50 |
Runtime |
processor-keep-alive-time | When the number of processors is greater than the core, this is the maximum time that excess idle processors will wait for new tasks before terminating, in seconds. |
300 |
Runtime |
processor-stop-max-wait | The max duration (in milliseconds) of message exchange processing on stop phase (for all processors). |
15000 |
Runtime |
time-beetween-async-cleaner-runs | The time (in milliseconds) between two runs of the asynchronous message exchange cleaner. |
2000 |
Installation |
properties-file | Name of the file containing properties used as reference by other parameters. Parameters reference the property name using a placeholder in the following pattern ${myPropertyName}. At runtime, the expression is replaced by the value of the property. The properties file can be reloaded using the JMX API of the component. The runtime configuration MBean provides an operation to reload these place holders. Check the service unit parameters that support this reloading. The value of this parameter is :
|
- | Installation |
monitoring-sampling-period | Period, in seconds, of a sample used by response time probes of the monitoring feature. | 300 | Installation |
activate-flow-tracing | Enable ('true') or disable ('false') the flow tracing. This value can be overridden at service consumer or service provider level, or at exchange level. | true | Runtime |
propagate-flow-tracing-activation | Control whether the flow tracing activation state must be propagated to next flow steps or not. If 'true', the flow tracing activation state is propagated. This value can be overridden at service consumer level. | true | Runtime |
component-interceptors | Component interceptor configuration. See CDK Component interceptor configuration. | - | See Maven Petals plugin to known how to inject component interceptor configuration in component configuration |
* Definition of CDK parameter scopes:
- Installation: The parameter can be set during the installation of the component, by using the installation MBean (see JBI specifications for details about the installation sequence). If the parameter is optional and has not been defined during the development of the component, it is not available at installation time.
- Runtime: The paramater can be set during the installation of the component and during runtime. The runtime configuration can be changed using the CDK custom MBean named RuntimeConfiguration. If the parameter is optional and has not been defined during the development of the component, it is not available at installation and runtime times.
Interception configuration
Interceptors can be defined to inject some post or pre-processing in the component during service processing.
Using interceptor is very sensitive and must be manipulated only by power users. A non properly coded interceptor engaged in a component can lead to uncontrolled behaviors, out of the standard process.
Example of an interceptor configuration:
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" ...> <jbi:component> <!--...--> <petalsCDK:component-interceptors> <petalsCDK:interceptor active="true" class="org.ow2.petals.myInterceptor" name="myInterceptorName"> <petalsCDK:param name="myParamName">myParamValue</petalsCDK:param> <petalsCDK:param name="myParamName2">myParamValue2</petalsCDK:param> </petalsCDK:interceptor> </petalsCDK:component-interceptors> <!--...--> </jbi:component> </jbi:jbi>
Interceptors configuration for Component (CDK)
Parameter | Description | Default | Required |
---|---|---|---|
interceptor - class | Name of the interceptor class to implement. This class must extend the abstract class org.ow2.petals.component.common.interceptor.Interceptor. This class must be loadable from the component classloader, or in a dependent Shared Library classloader. | - | Yes |
interceptor - name | Logical name of the interceptor instance. It is referenced at service unit level to register this interceptor for services of the service unit. See SU Interceptor configuration. | - | Yes |
interceptor - active | If true, the Interceptor instance is activated for every SU deployed on the component. If false, the Interceptor can be activated: -by the InterceptorManager Mbean at runtime, to activate the interceptor for every deployed SU. -by a SU configuration |
- | Yes |
param[] - name | The name of the parameter to use for the interceptor. | - | No |
param[] | The value of the parameter to use for the interceptor. | - | No |
Dedicated configuration
These parameters drive features proposed by the component and configure the embedded SOAP servers and clients:
-
- embedded HTTP server,
- embedded HTTP web-service clients,
- embedded JMS client listenning incoming messages.
Parameters of the embedded HTTP server
Parameter | Description | Default | Required |
---|---|---|---|
http-port | HTTP port of the Jetty embedded server |
8084 | No |
http-host | Local Hostname to be used, can be hostname or host IP address. If the value of the parameter is empty (default configuration), all interfaces are listen. |
- | Yes |
http-service-list | Enables to display the available Web Service list on http://<http-host>:<http-port>/ <http-service-context>/<http-service-mapping>/listServices. Possible values are: true, false. |
true | No |
http-service-context | The URL context. | petals | No |
http-service-mapping | The URL service mapping. | services | No |
http-thread-pool-size-min | The minimum size of the HTTP thread pool. | 2 | No |
http-thread-pool-size-max | The maximum size of the HTTP thread pool. | 255 | No |
http-acceptors | Number of acceptors for HTTP. Its value is limited to the number of available CPU. Caution, as an acceptor is a thread borrowed from the thread pool, the values of http-thread-pool-size-min and http-thread-pool-size-max MUST take into account this value. If http-thread-pool-size-max < http-acceptors + https-acceptors, no request can be processed. | 4 | No |
http-backlog-size | The size of the TCP queue in which incoming HTTP connection request are put waiting to be accepted. | 50 | No |
https-enabled |
Enable the HTTPS support. Possible values are: true, false. |
false |
No |
https-port |
HTTPS port of the Jetty embedded server | 8083 |
No |
https-acceptors | Number of acceptors for HTTPS. Its value is limited to the number of available CPU. Caution, as an acceptor is a thread borrowed from the thread pool, the values of http-thread-pool-size-min and http-thread-pool-size-max MUST take into account this value. If http-thread-pool-size-max < http-acceptors + https-acceptors, no request can be processed. | 4 | No |
https-backlog-size | The size of the TCP queue in which incoming HTTPS connection request are put waiting to be accepted. | 50 | No |
https-keystore-type |
Type of the keystore. Possible values are: JKS, PKCS12. |
JKS |
No |
https-keystore-file | File path of the keystore. The SSL support is disabled if the keystore file does not exist, and a WARNING is logged. |
- |
No |
https-keystore-password |
Password of the keystore. |
- |
No |
https-key-password |
Password of the key. |
- |
No |
https-truststore-type |
Type of the truststore. Possible values are: JKS, PKCS12. |
JKS |
No |
https-truststore-file |
File path of the truststore. | - |
No |
https-truststore-password |
Password of the truststore. | - |
No |
Parameters of the embedded HTTP web-service clients
Parameter | Description | Default | Required |
---|---|---|---|
max-http-connections-per-host | Max concurrently opened connections to external services (used by provides). | The max size of the message exchange processor thread pool (processor-max-pool-size) | No |
Parameters of the embedded JMS client listenning incoming messages
Parameter | Description | Default | Required |
---|---|---|---|
java-naming-factory-initial | The initial context factory class needed to access the JNDI server where the JMS connection factory can be found. | - | No |
java-naming-provider-url | The JNDI provider URL where the JMS connection factory can be found. | - | No |
jms-connection-factory-jndiname | Name of the default JMS connection factory in the JNDI. | - | No |
Example of component configuration
<?xml version="1.0" encoding="UTF-8"?> <jbi:jbi version="1.0" xmlns:jbi="http://java.sun.com/xml/ns/jbi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5" xmlns:soap="http://petals.ow2.org/components/soap/version-4"> <jbi:component type="binding-component" bootstrap-class-loader-delegation="parent-first"> ... <!-- HTTPS support --> <soap:http-port>8080</soap:http-port> <!-- HTTPS support --> <soap:https-enabled>true</soap:https-enabled> <soap:https-port>8081</soap:https-port> <soap:https-keystore-type>JKS</soap:https-keystore-type> <soap:https-keystore-file>../https/serverKeystore.jks</soap:https-keystore-file> <soap:https-keystore-password>passwordServerKeystore</soap:https-keystore-password> <soap:https-key-password>petalsServerK</soap:https-key-password> <soap:https-truststore-type>JKS</soap:https-truststore-type> <soap:https-truststore-file>../https/serverTruststore.jks</soap:https-truststore-file> <soap:https-truststore-password>passwordServerTruststore</soap:https-truststore-password> <!-- JMS transport layer --> <soap:java-naming-factory-initial>org.apache.activemq.jndi.ActiveMQInitialContextFactory</soap:java-naming-factory-initial> <soap:java-naming-provider-url>tcp://localhost:61616</soap:java-naming-provider-url> <soap:jms-connection-factory-jndiname>QueueConnectionFactory</soap:jms-connection-factory-jndiname> </jbi:component> </jbi:jbi>
Business monitoring
MONIT traces
Each service provider exposed in Petals ESB is able to log MONIT traces with following information:
- on service provider invocation, when receiving an incoming request, with following attributes:
- traceCode set to provideFlowStepBegin,
- flowInstanceId set to the flow instance identifier retrieved from the incoming request,
- flowStepId set to an UUID value,
- flowStepInterfaceName set to the service provider interface name,
- flowStepServiceName set to the service provider service name,
- flowStepOperationName set to the operation of the invoked service provider,
- flowStepEndpointName set to the service provider endpoint name,
- flowPreviousStepId set to the step identifier of the previous step, retrieved from the incoming request.
- on external service provider invocation, when sending a request to the external service provider, with following attributes:
- traceCode set to provideExtFlowStepBegin,
- flowInstanceId set to the flow instance identifier retrieved from the incoming request,
- flowStepId set to an UUID value,
- flowPreviousStepId set to the step identifier of the previous step that is the internal processing of the incoming request into the BC.
- on external service provider termination, when receiving the outgoing response of the external service provider, with following attributes:
- traceCode set to provideExtFlowStepEnd or provideExtFlowStepFailure,
- flowInstanceId set to the flow instance identifier retrieved from the incoming request,
- flowStepId set to the flow step identifier defined for the external service provider invocation.
- on service provider termination, when returning the outgoing response, with following attributes:
- traceCode set to provideFlowStepEnd or provideFlowStepFailure,
- flowInstanceId set to the flow instance identifier retrieved from the incoming request,
- flowStepId set to the flow step identifier defined on incoming request receipt.
Following MONIT level traces have information specific to the component defined here:
Trace code | Description | Specific information | Message content stored |
---|---|---|---|
consumeExtFlowStepBegin | An external incoming web-service request received |
|
|
provideExtFlowStepBegin | An external outgoing web-service request is sent |
|
Flow tracing activation
The flow tracing (ie. MONIT traces generation) is defined according to the property 'org.ow2.petals.monitoring.business.activate-flow-tracing' of the incoming request. If the property does not exist, the parameter activate-flow-tracing of the service provider definition will be inspected. If no parameter is defined at service provider level, the component configuration parameter 'activate-flow-tracing' is used. Finally, by default, the flow tracing is enabled.
On service consumer side, the flow tracing can be enabled ('true') or disabled ('false') per request using the HTTP header org.ow2.petals.monitoring.activate-flow-tracing. If not defined, the flow tracing will be activated according to the service consumer definition.
Monitoring the component
Using metrics
Several probes providing metrics are included in the component, and are available through the JMX MBean 'org.ow2.petals:type=custom,name=monitoring_<component-id>', where <component-id> is the unique JBI identifier of the component.
Common metrics
The following metrics are provided through the Petals CDK, and are common to all components:
Metrics, as MBean attribute | Description | Detail of the value | Configurable |
---|---|---|---|
MessageExchangeAcceptorThreadPoolMaxSize | The maximum number of threads of the message exchange acceptor thread pool | integer value, since the last startup of the component | yes, through acceptor-pool-size |
MessageExchangeAcceptorThreadPoolCurrentSize | The current number of threads of the message exchange acceptor thread pool. Should be always equals to MessageExchangeAcceptorThreadPoolMaxSize. | instant integer value | no |
MessageExchangeAcceptorCurrentWorking | The current number of working message exchange acceptors. | instant long value | no |
MessageExchangeAcceptorMaxWorking | The max number of working message exchange acceptors. | long value, since the last startup of the component | no |
MessageExchangeAcceptorAbsoluteDurations | The aggregated durations of the working message exchange acceptors since the last startup of the component. | n-tuple value containing, in nanosecond:
|
no |
MessageExchangeAcceptorRelativeDurations | The aggregated durations of the working message exchange acceptors on the last sample. | n-tuple value containing, in nanosecond:
|
no |
MessageExchangeProcessorAbsoluteDurations | The aggregated durations of the working message exchange processor since the last startup of the component. | n-tuple value containing, in milliseconds:
|
no |
MessageExchangeProcessorRelativeDurations | The aggregated durations of the working message exchange processor on the last sample. | n-tuple value containing, in milliseconds:
|
no |
MessageExchangeProcessorThreadPoolActiveThreadsCurrent | The current number of active threads of the message exchange processor thread pool | instant integer value | no |
MessageExchangeProcessorThreadPoolActiveThreadsMax | The maximum number of threads of the message exchange processor thread pool that was active | integer value, since the last startup of the component | no |
MessageExchangeProcessorThreadPoolIdleThreadsCurrent | The current number of idle threads of the message exchange processor thread pool | instant integer value | no |
MessageExchangeProcessorThreadPoolIdleThreadsMax | The maximum number of threads of the message exchange processor thread pool that was idle | integer value, since the last startup of the component | no |
MessageExchangeProcessorThreadPoolMaxSize | The maximum size, in threads, of the message exchange processor thread pool | instant integer value | yes, through http-thread-pool-size-max |
MessageExchangeProcessorThreadPoolMinSize | The minimum size, in threads, of the message exchange processor thread pool | instant integer value | yes, through http-thread-pool-size-min |
MessageExchangeProcessorThreadPoolQueuedRequestsCurrent | The current number of enqueued requests waiting to be processed by the message exchange processor thread pool | instant integer value | no |
MessageExchangeProcessorThreadPoolQueuedRequestsMax | The maximum number of enqueued requests waiting to be processed by the message exchange processor thread pool since the last startup of the component | instant integer value | no |
ServiceProviderInvocations | The number of service provider invocations grouped by:
|
integer counter value since the last startup of the component | no |
ServiceProviderInvocationsResponseTimeAbs | The aggregated response times of the service provider invocations since the last startup of the component grouped by:
|
n-tuple value containing, in millisecond:
|
no |
ServiceProviderInvocationsResponseTimeRel | The aggregated response times of the service provider invocations on the last sample, grouped by:
|
n-tuple value containing, in millisecond:
|
no |
Dedicated metrics
Moreover the common metrics, some dedicated probes are include on the component:
Metrics, as MBean attribute | Description | Detail of the value | Configurable |
---|---|---|---|
HttpServerThreadPoolActiveThreadsCurrent | The current number of active threads of the HTTP thread pool | instant integer value | no |
HttpServerThreadPoolActiveThreadsMax | The maximum number of threads of the HTTP thread pool that was active | integer value, since the last startup of the component | no |
HttpServerThreadPoolIdleThreadsCurrent | The current number of idle threads of the HTTP thread pool | instant integer value | no |
HttpServerThreadPoolIdleThreadsMax | The maximum number of threads of the HTTP thread pool that was idle | integer value, since the last startup of the component | no |
HttpServerThreadPoolMaxSize | The maximum size, in threads, of the HTTP thread pool | instant integer value | yes, through http-thread-pool-size-max |
HttpServerThreadPoolMinSize | The minimum size, in threads, of the HTTP thread pool | instant integer value | yes, through http-thread-pool-size-min |
HttpServerThreadPoolQueuedRequestsCurrent | The current number of enqueued requests waiting to be processed by the HTTP thread pool | instant integer value | no |
HttpServerThreadPoolQueuedRequestsMax | The maximum number of enqueued requests waiting to be processed by the HTTP thread pool since the last startup of the component | instant integer value | no |
IncomingWsRequestsCounter | The number of incoming webservice requests grouped by:
|
integer counter value since the last startup of the component | no |
IncomingWsRequestsResponseTimeAbs | The aggregated response times of the incoming web-service requests since the last startup of the component grouped by:
|
n-tuple value containing, in millisecond:
|
no |
IncomingWsRequestsResponseTimeRel | The aggregated response times of the incoming web-service requests on the last sample, grouped by:
|
n-tuple value containing, in millisecond:
|
no |
InformationURLsCounter | The number of HTTP requests associated to the information servlet | integer counter value since the last startup of the component | no |
ServiceContractsCounter | The number of a service contract request ('http://<server>:<port>/petals/services/<service-name>?wsdl' per HTTP(S)/SOAP service | integer counter value since the last startup of the component grouped by service | no |
OutgoingWsRequestsCounter | The number of outgoing web-service requests to external web-service grouped by:
|
integer counter value since the last startup of the component | no |
OutgoingWsRequestsResponseTimeAbs | The aggregated response times of the outgoing web-service requests since the last startup of the component grouped by:
|
n-tuple value containing, in millisecond:
|
no |
OutgoingWsRequestsResponseTimeRel | The aggregated response times of the outgoing web-service requests on the last sample, grouped by:
|
n-tuple value containing, in millisecond:
|
no |
UnknownURLsCounter | The number of HTTP requests associated to an unknown servlet or web-service | integer counter value since the last startup of the component | no |
WsClientPoolClientsInUseCurrent | The current number of web-service client in use, grouped by:
|
integer instant value | no |
WsClientPoolClientsInUseMax | The maximum number of web-service client in use, grouped by:
|
integer value, since the last startup of the component | no |
WsClientPoolExhaustions | The number of exhaustion of the web-service client pool, grouped by:
|
integer counter value, since the last startup of the component | no |
Receiving alerts
Several alerts are notified by the component through notification of the JMX MBean 'org.ow2.petals:type=custom,name=monitoring_<component-id>', where <component-id> is the unique JBI identifier of the component.
To integrate these alerts with Nagios, see Receiving Petals ESB defects in Nagios. |
Common alerts
Defect | JMX Notification |
---|---|
A message exchange acceptor thread is dead |
|
No more thread is available in the message exchange acceptor thread pool |
|
No more thread is available to run a message exchange processor |
|
Dedicated alerts
Moreover the common metrics, some dedicated alerts can be sent by the component:
Defect | JMX Notification |
---|---|
No more thread is available in the HTTP thread pool |
|
No more web-service client is available |
|
Operation resolving: Mapping from URI, SOAP/WSA Action, Document/Literal-wrapped pattern and RPC/Literal pattern
The SOAP BC serves many SOAP services to the exterior (defined by JBI Consumes in the deployed SU) at the same time.
While it is not difficult for it to know which service is concerned by a request (because its name is in the called URI), determining the concerned operation is more complex.
There exists many ways to approach this question (see for example http://www.ibm.com/developerworks/library/ws-whichwsdl/).
In Petals we support the most common ones (those that are provided by Axis2) in that order:
- URI: if the service call's URI has the form: .../services/MyService/myOperation then the operation will be myOperation.
- SOAP/WSA Action: if the http header contains a SOAP Action or the SOAP message header contains a WSA Action, then it will be used to resolve the operation as defined in the WSDL.
- Document/Literal wrapping: from the first element's QName of the body, the operation that contains the message that contains the part that refers to this element is used.
- RPC/Literal: from the first element's localName (and not full QName) of the body, the operation that has the same name will be used.
For the last two, in case of ambiguity, the call will fails.
Advanced usages
Getting log traces from the underlying layers
The Petals BC SOAP is based on Axis2 and Jetty 9.2. To get log traces from these underlying layers, just add something as the following configuration to the Petals ESB logging configuration:
Petals.Container.Components.level=MONIT # The following line enable debug traces from the BC SOAP itself Petals.Container.Components.petals-bc-soap.level=FINE # The following line enable debug traces from the underlying layer 'Jetty' org.eclipse.jetty.level=FINE # The following line enable debug traces from the underlying layer 'Axiom' org.apache.axiom.level=FINE # The following line enable debug traces from the underlying layer 'Axis2' org.apache.axis2.level=FINE org.apache.ws.security=FINE org.apache.rampart=FINE org.apache.commons.httpclient=FINE
Know problems
No HTTP/WS request is processed
When you try to invok a web-service with your favorite client, you get a time out instead of a standard response. A possible cause is configuration error of the HTTP thread pool. Check your configuration: the HTTP thread pool max size must be upper than the HTTP acceptor number, see the component configuration.
Error invoking a service with 2+ attachments from SoapUI
If you get an error invoking a service with at least two attachments from SoapUI, check that you have enabled the multi-part mode in the SoapUI properties of the request.
"sec_error_inadequate_cert_type" appears when trying to get services list available through SSL on the HTTPS client side
If get the error "sec_error_inadequate_cert_type" using a browser to get available services through SSL, check your SSL configuration of your BC SOAP. Probably, you inverse certificates usage: You configure the public key of the server instead its private key.
"sec_error_bad_cert_alert" appears when trying to get services list available through SSL on the HTTPS client side
You get this error on the HTTPS client side when the client authentication is enabled on the server side and no or bad certificate is available on the client side.
Receiving fault "WSDoAllReceiver: security processing failed (actions mismatch)" invoking a webservice secured by WS-Security
The following fault returned by the BC SOAP to our client means that you have not set all required WS-Security headers. Check you client configuration against WS-Security configuration expected by the webservice.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>WSDoAllReceiver: security processing failed (actions mismatch)</faultstring>
<detail>
...
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>