I have a requirement to build a REST service in Talend so that it can be called from Java REST Miscroservice hosted in Cloud, it will be a POST request and it will pass my REST service 3 values. I then take those fields and insert the record in a table and send back an ID. I have successfully built that job in Talend Enterprise version. I tested the REST call via Postman. Talend set the REST endpoint to my localhost:<port>.
The issue I am having is, my teammates have also tried to test it via Postman but they get no response since its localhost. How can I be able to provide them a REST endpoint that can be accessible externally, and not just via my localhost. Any help would be appreciated. I have searched for this topic in the forums but haven't found a solution I understand. Thanks!
I assume that you were using the tRESTRequest/tRESTResponse components to build your REST job (not tREST because it's only doing the invoke), right?
and you build the REST job as Microservice jar and start it by "java -jar xxxx.jar"? or you just running the job from Studio inside?
Thanks for your response! Yes, I am using tRESTRequest/tRESTResponse components.
I'd usually run the job locally from inside Studio to test it out, but now I am working Remotely and it builds/deploys via Jenkins and then ends up in an Edge node server. That's where the executable .sh script is and we will be calling it from our scheduler to execute it.
Not sure if this is the right way or not for tREST component, so I'd appreciate any hints.
Okay, if I have right understand you're building a "Standalong Job" zip (jar and .sh) and executing it.
1) For the job with tRESTxxx components inside, it's for building REST service, and it's always recommended to build it as "OSGi bundle" or "Microservice". it depends which version of Talend Studio you're using, the "Microservice" type is supported from 6.4.x.
2) Try to find the IP address which exposed by your REST service with "netstat" command, if is "localhost" or "127.0.0.1", then it's only available/accessible locally, if it's "0.0.0.0" then the REST service can be accessed from remote.
if you build your REST service as "OSGi bundle" and deploy it into Talend Runtime, then the exposed IP should be "0.0.0.0";
if you build your REST service as "Microservice", the port can be configured by "--server.port"
(whatever you build your REST service via Studio UI, CI, commandLine)
Thank you for your response. We don't have Talend Runtime servers or TAC. Our code is build/deployed by IT via Jenkins and put into a Unix server. I tried executing the .sh and got the IP address of the server and I'm still not able to access the REST service, even tho I left the Endpoint URL relative...ie..."/blabla/myService"
Then it's not the desired deployment for tRESTRequest/tRESTResponse components. you were trying to build it as a standalong DI job and running it via CI/Jenkins. But for tRESTRequest/tRESTResponse, they are designed for Data Services, which has to be build as OSGi kar file and be deployed into Runtime OSGi container, or build/run it as Microservice jar.
Watch the recorded webinar!
Accelerate your data lake projects with an agile approach
Create systems and workflow to manage clean data ingestion and data transformation.
Introduction to Talend Open Studio for Data Integration.