
The export is the same in both Talend Open Studio and Talend Integration Suite.
The generated artifacts are the same in both of them. And the content of the jbi.xml is the same in both of them.
The only differences are the job's content (which Talend components have been added into the job) and the generated WSDL (which depends on the job content and the export options).
The service-unit structure and the jbi.xml are desribed farther.
This section only introduces the export options, their impact on the result.
The generated WSDL is not discussed in this documentation.
Here is a snapshot version of the Talend export for Petals.
!SimpleJobExport.jpg!
The target file is the location of the service-assembly to generate.
The job version meaning is explicit.
The export options are the following:
|| Export Option || Description ||
| Singleton job | True to make the job singleton. A singleton job can have only one instance running at once on a given Petals-SE-Talend component. |
| Generate the end-point | True to let Petals generate the end-point at deployment time. If false, the end-point name is the job name with the suffix "Endpoint". |
| Validate Petals messages | True to validate all the messages / requests against the WSDL. \\
Be careful, enabling this option reduces the performances (disk access). \\ |
| User routines | Embed the user routines in the service-unit. |
| Source files | True to embed the source files in the generated service-unit. |
| Jobs contexts | Select the context that will be used by default by the job. |
\\
Eventually, there is the edition link to specify how contexts should be exposed in the generated WSDL.
!SimpleJobExportContext1.jpg!
When this link is clicked, a dialog shows up.
It lists all the job contexts, with their name, the type they will be associated with if exported, and the way they are exported.
By default, no context is exported. Said differently, the export mode for all the contexts is *Not exported*.
\\
Here is a small description of the export modes.
|| Export Mode || Description ||
| Not exported | The context is not exported (not visible as a parameter). But the context can still be overridden using the native parameters (options) of the job. |
| Parameter | The context is exported as a parameter in the contexts. |
| In-Attachment | The context will be passed the location of a temporary file whose content was attached in the input message. |
| Out-Attachment | The context will be read after the job was executed.
* This context must point to a file.
* The file content will be read by the Petals-SE-Talend component and put as an attachment into the response.
* The context name will be used as the attachment name.
* The file will be deleted by the component right after its content was loaded. |
| Parameter and Out-Attachment | A mix between the Parameter and the Out-Attachement modes.
* The context is exposed as a parameter.
* It will also be read after the job execution.
* The file will be deleted anyway.
* The advantage of this export mode is to define the output file destination dynamically. |
h1. Component Configuration
The component can be configured through its JBI descriptor file, as shown below.
{code:lang=xml}<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi
version="1.0"
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"
xmlns:talend="http://petals.ow2.org/components/talend/version-1">
<jbi:component type="service-engine">
<jbi:identification>
<jbi:name>petals-se-talend</jbi:name>
<jbi:description>A service engine to expose and run Talend jobs as services in Petals</jbi:description>
</jbi:identification>
<jbi:component-class-name>org.ow2.petals.se.talend.TalendSe</jbi:component-class-name>
<jbi:component-class-path>
<jbi:path-element/>
</jbi:component-class-path>
<jbi:bootstrap-class-name>org.ow2.petals.component.framework.DefaultBootstrap</jbi:bootstrap-class-name>
<jbi:bootstrap-class-path>
<jbi:path-element />
</jbi:bootstrap-class-path>
<!-- CDK specific fields -->
<petalsCDK:acceptor-pool-size>5</petalsCDK:acceptor-pool-size>
<petalsCDK:processor-pool-size>10</petalsCDK:processor-pool-size>
<petalsCDK:ignored-status>DONE_AND_ERROR_IGNORED</petalsCDK:ignored-status>
<petalsCDK:jbi-listener-class-name>org.ow2.petals.se.talend.TalendJBIListener</petalsCDK:jbi-listener-class-name>
<!-- Component specific configuration -->
<!--
The WSDL-based validation for exchanges checks that the called operation,
the MEP and the input message are valid with respect to the WSDL.
This property is also available for service-units.
Enabling this property in the component enables it for all the service-units
deployed on this component and overrides their configurations.
When set to false, the service-unit property is used.
Set this property to true to enable it, false to disable it.
This property is optional. Default is false.
Beware, performances are impacted if this property is enabled.
-->
<talend:validate-exchange-by-wsdl>false</talend:validate-exchange-by-wsdl>
</jbi:component>
</jbi:jbi>{code}
\\
The component configuration includes the configuration of the CDK. The following parameters correspond to the CDK configuration.
{include:0 CDK Component Configuration Table}
\\
This component also has one specific configuration parameter.
|| Parameter || Description || Default || Required ||
| validate-exchange-by-wsdl | True to validate the received messages with respect to the WSDL of the target service. \\ |
This parameter is also available in the configuration of the service-units.
\\
Setting it in the component enables it for all the service-units deployed on this component. It also overrides the service-unit configuration for this parameter.
\\
\\
Beware, for the moment, WSDL-based validation does not work with messages having attachments. \| false \| false \|
\\
{warning}
The Petals-SE-Talend component can only handle messages coming from inside the bus. Therefore, you cannot specify an external-listener class-name.{warning}
h1. Service Configuration
h2. Service Unit descriptor
The Service Unit descriptor file ( jbi.xml ) looks like this:
{code:lang=xml}<!-- Remember, this file is intended to be generated by Talend Open Studio or Talend Integration Suite -->
<?xml version="1.0" encoding="UTF-8"?>
<jbi:jbi version="1.0"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:talend="http://petals.ow2.org/components/talend/version-1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<jbi:services binding-component="false">
<jbi:provides
interface-name="generatedNs:AttachmentInOutServicePortType"
service-name="generatedNs:AttachmentInOutService"
endpoint-name="AttachmentInOutEndpoint"
xmlns:generatedNs="http://petals.ow2.org/talend/">
<!-- CDK parameters -->
<petalsCDK:wsdl>AttachmentInOut.wsdl</petalsCDK:wsdl>
<petalsCDK:validate-wsdl>true</petalsCDK:validate-wsdl>
<!-- Component parameters -->
<talend:name>AttachmentInOut</talend:name>
<talend:class-name>talenddemosjava.attachmentinout_0_1.AttachmentInOut</talend:class-name>
<talend:context>Default</talend:context>
<talend:singleton>true</talend:singleton>
<talend:validate-exchange-by-wsdl>false</talend:validate-exchange-by-wsdl>
<!--
Define all the expected output attachements.
There can be as many "output-attachment" as required.
-->
<talend:output-attachment>outputFile</talend:output-attachment>
</jbi:provides>
</jbi:services>
</jbi:jbi>
{code}
\\
*Configuration of a Service Unit to expose a Talend job as a service into Petals ESB :*
|| Parameter || Description || Default || Required ||
| name | The job's name \\ | \- | Yes |
| class-name | The job's class name \\ | \- | Yes |
| context | The context to use (if invalid, the job will use the default context) \\ | \- | Yes |
| singleton | The singleton property \\ | \- | Yes |
| validate-exchange-by-wsdl | Validate the messages against the WSDLs' schemas | False | No \\ |
| output-attachment \\ | The name of a context variable that points to a file that must be attached to the returned message. \\
The cardinality for this element is 0-*. \\ | \- | No \\ |
\\
{include:0 CDK SU Provide Configuration}
\\
{include:0 CDK Interceptor configuration for SU}
h2. Service Unit content
The service unit must contain the JAR archives of the job and its dependencies, plus JAR file containing all the contexts..
It is also highly recommended to provide a WSDL description of your job. This WSDL is not mandatory, but not providing it will prevent your service from interacting with other Petals services and components.
By default, a WSDL is generated during the Talend export for Petals.
\\
The directory structure of a SU for the Petals-SE-Talend looks like this:
{noformat}su-talend-JobName-provide.zip
* META-INF
** jbi.xml
* src
** { source files }
* JobName.wsdl
* contexts.jar
* systemRoutines.jar
* userRoutines.jar
* JobName_JobVersion.jar
* JobDependencies.jar (there can be several jars){noformat}