Ouptut to Web-API

Four Stars

Ouptut to Web-API

Hello,

 

I have aJob in the Open Studio for Big Data, which reads content from a sourve, convert it, and finally i got the rows and put it in an mysql-Database with tMysqlOutput-component. Instead of this tMysqlOutput-compoment I want to put the content of the row as xml or json-String  to an Web-Url. I have tried the components tHttpRequest and tRest, but that is not the soulution: Post-Parameters for tHttpRequest has to come from a file, and the tRest-component cannot use the row data. 

 

Are there any output components which I can use?

 

Thanks for help and regards

Thomas


Accepted Solutions
Community Manager

Re: Ouptut to Web-API

Use a tFlowToIterate and iterate from that. The your values for that iteration will be stored in the globalMap HashMap with the key "{rowname}.{columnname}" of the row going into the tFlowToIterate. So, as an example, if you have a row called row1 connecting to the tFlowToIterate and the row has 3 columns (col1 as a String, col2 as an Integer, and col3 as a Long), then you can access the values using the code below...

 

((String)globalMap.get("row1.col1"))
((Integer)globalMap.get("row1.col2"))
((Long)globalMap.get("row1.col3"))

View solution in original post


All Replies
Employee

Re: Ouptut to Web-API

We have tRestClient (for Rest) and tESBConsumer (for Soap) where you can pass an XML or JSON payload as a document to the component.  Check out their documentation on https://help.talend.com

Four Stars

Re: Ouptut to Web-API

Thanks for the tip. But with this component I have no Chance to connect from e.g. tFileInputExcel. My Idea was, send some data directly to a rest-URL And If i choose "iterate", i have no row- Variables, which i can use as parameter for the rest-url.

Possible some code in tjavarow may help, or is there a possible solution with tRest ?

 

Thanks for help and kind regards

Thomas

Community Manager

Re: Ouptut to Web-API

Use a tFlowToIterate and iterate from that. The your values for that iteration will be stored in the globalMap HashMap with the key "{rowname}.{columnname}" of the row going into the tFlowToIterate. So, as an example, if you have a row called row1 connecting to the tFlowToIterate and the row has 3 columns (col1 as a String, col2 as an Integer, and col3 as a Long), then you can access the values using the code below...

 

((String)globalMap.get("row1.col1"))
((Integer)globalMap.get("row1.col2"))
((Long)globalMap.get("row1.col3"))

View solution in original post

Four Stars

Re: Ouptut to Web-API

Thats it! With this I can post the contents to the URL - Good solutions, which saves a lot of time. Thanks!

 

Regards

Thomas

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

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog