[resolved] How to pass tJava output as header data to tRest client component

One Star

[resolved] How to pass tJava output as header data to tRest client component

 am creating a Job to set cookie value for tRestClient component.
To acheive this task i wrote a Java code in tJava component and i am able to extract cookie data with this Java code. Now i want to pass this data to tRestClient component.
Please suggest a way to resolve pass the cookie data.

More details: Below is the expected talend job structure
tJava -> tRestClient

Accepted Solutions
Highlighted
Community Manager

Re: [resolved] How to pass tJava output as header data to tRest client component

Hi 
You can store the cookie value to a context variable or global variable for used on tRestClient. eg:
tJava ->oncomponentok--> tRestClient
on tJava:
...
String cookie=your java code;
globalMap.put("cookie",cookie);
on tRestClient, you can get the cookie value with this expression:
(String)globalMap.get("cookie")
Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Highlighted
Community Manager

Re: [resolved] How to pass tJava output as header data to tRest client component

Hi 
You can store the cookie value to a context variable or global variable for used on tRestClient. eg:
tJava ->oncomponentok--> tRestClient
on tJava:
...
String cookie=your java code;
globalMap.put("cookie",cookie);
on tRestClient, you can get the cookie value with this expression:
(String)globalMap.get("cookie")
Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read