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 2015-10-02 15:50:58

plumberg
Member
115 posts

plumberg said:

Capture Source Information

Is there any quick and easy way to capture source request information (like IP address/ hostname/ client details/ and anything else) of the source calling the REST request? 

Offline

#2 2015-10-04 21:35:34

sberyozkin
Talend Team


sberyozkin said:

Re: Capture Source Information

This can probably be optionally captured by tRESTRequest and saved in the request context. The short term solution is to do, in Java,
HttpServletRequest req = (HttpServletRequest)org.apache.cxf.jaxrs.utils.JAXRSUtils.getCurrentMessage().get("HTTP.REQUEST");
and check the client info...
I'll open a minor new feature request in meantime
Cheers, Sergey

Offline

#3 2015-10-05 14:08:03

plumberg
Member
115 posts

plumberg said:

Re: Capture Source Information

sberyozkin wrote:

This can probably be optionally captured by tRESTRequest and saved in the request context. The short term solution is to do, in Java,
HttpServletRequest req = (HttpServletRequest)org.apache.cxf.jaxrs.utils.JAXRSUtils.getCurrentMessage().get("HTTP.REQUEST");
and check the client info...
I'll open a minor new feature request in meantime
Cheers, Sergey

Thank you Sergey. I think this would work in the interim. 

Offline

#4 2017-02-23 17:07:59

plumberg
Member
115 posts

plumberg said:

Re: Capture Source Information

Sorry to bring up this old post.
This statement is not returning any client IP address. Any help is appreciated

HttpServletRequest req = (HttpServletRequest)org.apache.cxf.jaxrs.utils.JAXRSUtils.getCurrentMessage().get("HTTP.REQUEST"); 

Offline

#5 2017-02-23 18:29:38

sberyozkin
Talend Team


sberyozkin said:

Re: Capture Source Information

Offline

#6 2017-02-23 19:31:59

plumberg
Member
115 posts

plumberg said:

Re: Capture Source Information

Hi, That does not work for me. it says 
I used: 

HttpServletRequest req = (HttpServletRequest)org.apache.cxf.jaxrs.utils.JAXRSUtils.getCurrentMessage().getRemoteAddr();
System.out.println(req);

Error:

Execution failed : Job compile errors 
At least job "ac_mq" has a compile errors, please fix and export again.
Error Line: 1841
Detail Message: The method getRemoteAddr() is undefined for the type Message
There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.
Job ac_mq ended at 13:28 23/02/2017. [exit code=0]

Thanks

Offline

#7 2017-02-28 16:11:39

plumberg
Member
115 posts

plumberg said:

Re: Capture Source Information

Any help please? Thank you.

Offline

Board footer

Talend Contributor Agreement - Talend Website Privacy Policy