Working with Talend

It is possible to expose Talend jobs as services in Petals ESB.
In practice, any job created with Talend Open Studio and Talend Integration Suite can be exported as a Petals service.

This page briefly resumes the way a Talend job can be exported for Petals ESB.
It also explains how it is possible to reedit the exported job in the studio.

Exporting a Talend job for Petals ESB

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 (almost) 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 export result is a service assembly, containing a service-unit for the Talend service engine.
The service-unit contains a JBI descriptor, a WSDL and the job resources.
This section only introduces the export options and their impact on the result.

Here is a snapshot of the Talend export for Petals.

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.

When this link is clicked, a dialog shows up.
It lists all the context variables from the job, 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 WSDL's operation.
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-Attachment 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.

Updating a Talend service assembly

Clearly, this should almost never happen.
The result of a job export for Petals ESB is a valid service assembly for the Talend service engine of Petals.

However, it already happened in a use case involving both Talend and BPEL: the generated WSDL definition had to be slightly changed.
In such a situation, it is possible to import the exported service assembly in the workspace, edit it and repackage it.
The transformation is transparent and only takes few minutes.

Creating a service consumer for a job

One common task involving a Talend service is to create a service consumer for it.
The studio eases such a creation.

What you have to do is to add a new service source in the Petals Services view.
Add a new SA folder and select the folder where the job was exported for Petals.
You should then see the service end-point in the view.

To create a service consumer, you then only have to follow one of the wizards to create a service consumer and select the Talend service.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.