You are not logged in.

Unanswered posts



Important! This site has been replaced. All content here is read-only. Please visit our brand-new community at https://community.talend.com/. We look forward to hearing from you there!



#1 2016-06-13 09:37:47

userTalend123
Member
4 posts

userTalend123 said:

Loading context from etc/ folder.

Hi,
I want to complete host in tRESTRequest component (REST Endpoint field) coming from 
configuration file located in the etc/jobname.cfg file. How can I do this?

I do not want to load the address of context in static way - it is to be loaded from 
configuration file.
When I run the project in Talend everything works correctly, but when I try
to deploy this project on server, it seems that the service is active in karaf, but 
was not made at the address/port specified in the .cfg file.

The contents of the configuration file:
host =



Thank you very much in advance,
Kamil

Offline

#2 2016-06-13 12:52:21

tal00000
Member
522 posts

tal00000 said:

Re: Loading context from etc/ folder.

You say that everything works fine in Talend (Studio), so you're already doing this? It is just not working when you deploy?

The simple answers is to read your file using tInputFileDelimited and then use tContextLoad to do its thing.
Also using tFileExist to gracefully report if the file can be located, together with usual Exception handling.


TalendByExample.com   TalendFramework.com
A site about Talend        A Talend Framework

Offline

#3 2016-06-14 13:49:28

userTalend123
Member
4 posts

userTalend123 said:

Re: Loading context from etc/ folder.

Thank you for answer. 
I did it like you advise.

As you can see address is loaded correctly, but after deploying I got some exception.
I will add that locally program works irreproachable. I enclose screenshot.

INFO   | jvm 1    | 2016/06/14 13:23:08 |
INFO   | jvm 1    | 2016/06/14 13:23:08 | Exception in component tRESTRequest_1_Loop
INFO   | jvm 1    | 2016/06/14 13:23:08 | java.lang.RuntimeException: request is not provided

Could you help me?
Thank you very much in advance,

Offline

#4 2016-06-16 10:06:36

xldai
Talend Team


xldai said:

Re: Loading context from etc/ folder.

Hi,

Normally, the REST Endpoint field of tRESTRequest component should only have relative path, you don't need to provide host:port info, by default running in Studio it will start on localhost:8090, by default running in Runtime karaf it will start on localhost:8040.

For using tRESTClient component, it make sense to using context parameter in the URL field, e.g. you define a context key named "host", and fill "context.host..." in the URL field of the tRESTClient in Studio, before you deploy it into Runtime, create a etc/jobName.cfg including one line host=xxxxx, that should work.


Regards.

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy