This scenario aims at helping you set up and use connectors in a pipeline. You are
advised to adapt it to your environment and use case.
Procedure
Click Connections > Add
connection.
In the panel that opens, select the type of connection you
want to create.
Example
REST destination
Select your engine
in the Engine list.
Information noteNote:
It is recommended to use the Remote Engine Gen2 rather than
the Cloud Engine for Design for advanced
processing of data.
If no Remote Engine Gen2 has been created from Talend Management Console or if it exists but appears as unavailable
which means it is not up and running, you will not be able to select
a Connection type in the list nor to
save the new connection.
The list of available connection types depends on the engine you
have selected.
Select the type of connection you want to create.
Here, select REST.
Fill in the connection properties and URL address of the REST server to be called
as described in REST properties, check the connection and click
Add dataset. In this example, the
https://requestinspector.com API service is used to post a
record with specific query parameters.
In the Add a new dataset
panel, name your dataset.
Example
Request Inspector
API
Fill in the required properties to connect to the
service:
In the Type
field, select Batch.
In the Resource field, type in
inspect/talend-doc/dataset/{/entity}/{/id} (where
talend-doc is the endpoint name that has been created
previously on Request inspector website).
In the HTTP
method field, select POST.
In the Answer body format field, select
Text.
Enable the Set
header option and enter header1
in the Name field and
header/{/val_head1} in the
Value field.
Enable the Set URL
parameters option and enter q in
the Name field and
query_{/q} in the
Value field.
Enable the Set path
parameters option and enter
entity in the Name
field and {/entity/type} in the
Value field. Add another path parameter and
enter id in the Name field
and {/entity/book/id} in the
Value field.
Enable the Define body option and select
JSON in the Body type list and
enter the following in the JSON field:
Add a Test dataset that will be used as a source in your
pipeline to post a fake record to the REST API destination. Fill in the
connection properties as described in Test connection properties and fill in the dataset properties as
follows:
Click Add
pipeline on the Pipelines page. Your new pipeline opens.
Give the pipeline a meaningful name.
Example
Generate a REST call using input
records
Click ADD SOURCE and
select your source dataset, Fake record
in the panel that opens.
Click the ADD
DESTINATION item on the pipeline to open the panel allowing to
select the output REST dataset which will allow you to post the record to the
URL defined on the https://requestinspector.com/ REST API.
Information noteNote: The REST connector
sends a request for each record received, so if you had 10 records, you
would generate 10 REST requests.
Click Save to
save your configuration.
On the top toolbar of Talend Cloud Pipeline Designer,
click the Run button to open the panel allowing you to select
your run profile.
Select your run profile in the list (for more information, see Run profiles), then click Run to
run your pipeline.
Results
Your pipeline is being executed, the fake record has been posted to the REST API service
according to the URL parameters you have defined in your REST dataset configuration.
You can then check the result of the call on the REST API and see that the query
parameters, the header as well as the body of the JSON record have been received on the
https://requestinspector.com/ dashboard:
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!