One Star

Deploying Talend REST Services using Karaf

Hi,
I have developped REST services jobs using Talend (ESB 5.4.1), and launched it has an Autonomous job and it worked well.
But I want to deploy it using the Talend Container service (which si based on Karaf).
I added the jar generated by Talend (Build > OSGI Bundle For ESB) to the deploy directory, and can see it as "Active" and "Created" in the bundle list in Karaf.
But I didn't find how to launch it...
Using the "start " command didn't give any feedback (nothing in the shell or in the tesb.log file)
Is there someone that could give me a little help to begin with it ? (never used that kind of services before) I could not find any tutorial applying to this case, if someone knows one that apply to this usage.
Thanks and sorry for asking such basic questions !

12 REPLIES
Employee

Re: Deploying Talend REST Services using Karaf

Hi
Welcome and thanks for the query,
You should see the INFO and higher level log statements in the log sub-directory. You can control the log level in etc/org.ops4j.pax.logging.cfg.
HTH, Sergey
Employee

Re: Deploying Talend REST Services using Karaf

Hi,
"Active" and "Created" are good enough and then you should open your browser and check if your REST service is available in the list of http://localhost:8040/services
Regards.
One Star

Re: Deploying Talend REST Services using Karaf

Hi, and thanks for the replies.
I can see my REST service at http://localhost:8040/services
Available RESTful services:
Endpoint address: http://localhost:8040/services/context.restUrl
WADL : http://localhost:8040/services/context.restUrl?_wadl
When I click on the WADL link it displays a XML file.
But if I can't reach my REST service (that should be on localhost:9002). How should I be supposed to access the REST service ?
For information, context.restUrl is the only variable of context that can be modified when the job is run with command lines (it allows the user to define the address of the REST service)
I'm sorry I don't get how this works
Employee

Re: Deploying Talend REST Services using Karaf

Hi, if you need to run the services on a different port then you can update an "org.osgi.service.http.port" porperty in etc/org.ops4j.pax.web.cfg
Cheers, Sergey
One Star

Re: Deploying Talend REST Services using Karaf

Thanks for the tip !
But here my problem is that I'm not able to reach my REST endpoint (use my REST service), I just can see that it seems to work. But I don't know how to reach my REST endpoint and use it...
Employee

Re: Deploying Talend REST Services using Karaf

How do you invoke on your service ? Is it even not available on 8040 ?
One Star

Re: Deploying Talend REST Services using Karaf

I'm on Ubuntu 13.04, I use the container from Talend ESB 5.4.1
To run the service I go in the following directory: $TALEND_HOME/Runtime_ESBSE/container/bin
And launch start (./start) to start the service, then client (./client) to connect to the shell.
I've put the OSGI (the jar file of my REST service) in the deploy directory.
All I get from localhost:8040 is in the uploaded screenshot. And if I click the link http://localhost:8040/services/context.restUrl?_wadl
It opens a XML file (that is shown on the 2nd screenshot)
Employee

Re: Deploying Talend REST Services using Karaf

Right, but how do you expect to interact with your service ? You mentioned you made it working in the studio. So how did you get this service consumed in the studio, for example, did you get some data from the service and how did you do it ?
Cheers, Sergey
One Star

Re: Deploying Talend REST Services using Karaf

My service is used to consume data from the web. The user enters a specific URL (containing the request) and the service returns data.
Employee

Re: Deploying Talend REST Services using Karaf

I'm sorry, I don;t understand, given that the service is already working, how the container is preventing the service from being used.
When you run the service in the studio it is returning some data to the user. The same is expected to happen in the container.
Perhaps you should open a JIRA and attach a test project there for the team to look at...
Cheers, Sergey
One Star

Re: Deploying Talend REST Services using Karaf

Hi,
I have found the problem, actually I'm able to reach the REST endpoint but I get Error 500 (Server error) when I try to use some functionnalities of my REST service (this will be another exciting story I guess !)
Thanks for the help, and sorry for taking your time for such basic questions.
Employee

Re: Deploying Talend REST Services using Karaf

Hi, no problems,
at least you have an error reported from the live endpoint which is good :-)
Sergey