tRESTResponse properties - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

Warning

This component is available only to users of Talend Studio with ESB.

Component family

ESB/REST

 

Function

tRestResponse sends HTTP and/or HTTPS responses to the client end when receiving the HTTP and/or HTTPS requests.

Note

To enable the HTTPS support, you have to generate a keystore and add some HTTPS security configuration properties in the org.ops4j.pax.web.cfg file of your Runtime container. For more information, see the Talend ESB Container Administration Guide.

Purpose

This component allows you to return a specific HTTP status code to the client end as a response to the HTTP request.

Basic settingsReturn Body Type Select a response body type from Document, String, and Byte[] in the list.
  Return status code

Select a status code from the list to indicate the request status.

- <<Custom>>: This option allows you to customize the status code. Enter the status code of your choice in the field.

- Bad Request (400): The request had bad syntax or was inherently impossible to be satisfied.

- Internal Server Error (500): The server encountered an unexpected condition which prevented it from fulfilling the request.

- OK (200): The request was fulfilled.

- Resource Not Found (404): The server has not found anything matching the URI given.

 

Schema and Edit schema

A schema is a row description, that is, it defines the number of fields to be processed and passed on to the next component.

The schema mode is Built-in: it is created and stored locally for this component.

Click Edit schema to make changes to the schema.

The input flow is retrieved from the previous component connected to tRESTResponse. Any change of the input flow in tRESTResponse will also be propagated to the previous component automatically.

The output flow of tRESTResponse is a hard-coded field named body, the type of which is defined in the Return Body Type list.

Advanced settings

Response Headers

Type in the name-value pair(s) to pass additional information about the response. For more information about response headers, see the site http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.2.

 

Drop JSON Response Root

Select this check box to drop the root JSON element in the response.

 

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at a Job level as well as at each component level.

Global Variables

NB_LINE: the number of rows processed. This is an After variable and it returns an integer.

ERROR_MESSAGE: the error message generated by the component when an error occurs. This is an After variable and it returns a string. This variable functions only if the Die on error check box is cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl + Space to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio User Guide.

Usage

This component covers the possibility that a Talend Job can be wrapped as a service, with the ability to input a request to a service into a Job and return the Job result as a service response.

The tRESTResponse component should only be used with the tRESTRequest component to provide a Job result as response for a web service provider, in case of a request-response communication style.

Limitation

n/a