tRestResponse Help

Eight Stars

tRestResponse Help

Is there any way to capture the "response" which is generated from tRestResponse (after the response is sent)? I have a need to save the responses for audit purposes.

 

 

java.util.Map<String, Object> response = (java.util.Map<String, Object>) globalMap.get("restResponse");
System.out.println( "Res: " + response );

--> This gives:
{drop.json.root.element=true, STATUS=200, HEADERS={}, BODY=org.dom4j.tree.DefaultDocument@32f7902f [Document: name null]}

System.out.println( "ResStream: " + (String) globalMap.get("restResponseStream") );
--> This is null

I tried above globalMap values, but am unsuccessful. 

Five Stars

Re: tRestResponse Help

Hi,

 

tRestresponse has it own schema. Use that schema only to get output. Response comes under that schema only.

Eight Stars

Re: tRestResponse Help

@kate: I am not sure if I am following you. I need to capture the "response" generated by tRestResponse. Something to the effect of the headers and payload generated to be sent out. I do not see any OUT links coming from the tRestResponse component.
Eight Stars

Re: tRestResponse Help

Shameles bump. Is it even possible to capture the payload once its sent? the tRestResponse component does not seem to have any output links/ globalmap variables to use. Any help is appreciated. Thank you

Eight Stars

Re: tRestResponse Help

Shameless bump. Any help appreciated!
Moderator

Re: tRestResponse Help

Hello,

Do you want to output the response on console to a specific file?

Best regards

Sabrina

 

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Eight Stars

Re: tRestResponse Help

@xdshi: Well, I was thinking to save it in a DB table. but I can definitely live with the fact that a file can hold the response for each request.

I checked tesb.log and it contains lots of these request/ responses. But, going through multiple files is a very exhaustive process to find a particular request/ response

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.