tRESTClient: Error writing request body to server

One Star

tRESTClient: Error writing request body to server

Hi Experts,
I have some problems when I use tRESTClient. The case is bellow:
A tRESTClient is used between tRESTRequest and tRESTReponse. We call this rest service dataService. Run the dataService and use multithreading to send messages to dataService. But exception occur during the process. I found it point on tRESTClient. The exception is:
1? org.apache.cxf.jaxrs.provider.AbstractJAXBProvider handleExceptionStart
WARNING: javax.xml.stream.XMLStreamException: java.io.IOException: Error writing request body to server.
2? WARNING: javax.xml.stream.XMLStreamException: org.codehaus.jettison.json.JSONException: Error writing request body to server.
We have test about it. It throws exception by chance . Using the same sum of multithreading to send messages of the same order, sometime it runs very smooth without an exception but sometime it throws an exception like above.
Please give me a guide for it, ths.
Regards,
Beck
Employee

Re: tRESTClient: Error writing request body to server

Any chance you can attach a simplified test job ? It appears that some of the generated code is not thread-safe, but we need a test case to investigate
cheers, Sergey
One Star

Re: tRESTClient: Error writing request body to server

Hi ,
I am new to Talend.I am using tRestClient component in one of my jobs.
The tRestClient  component has to process a huge data :80MB
The component is able to process upto 16MB only ,beyond that it is giving an exception.(stackTrace attached)
Is huge data handling possible in Talend?
Is any other alternative component available to handle this kind of request?
Regards,
Suviga
stackTrace.txt.txt
Employee

Re: tRESTClient: Error writing request body to server

Hi
I think there's no easy way to do it over HTTP but it is doable.
I guess the direct option is to increase the memory properties of a given container/Studio - I haven't dealt with it but I guess it is a typical Java VM configuration issue.
Having Talend Studio supporting InputStream would help in such cases to avoid buffering massive data in memory.
The other option, if it is possible in your case, is to run both tRESTClient and tRESTServer in a single job, tRESTClient would post a link to the target server with the link pointing to tRESTRequest server which is collocated with this tRESTClient. The target server will use the link to pull the massive data, possibly in chunks.
So even though it may not be trivial it is still doable 
HTH
Sergey
Employee

Re: tRESTClient: Error writing request body to server

Also, experiment with setting the advanced tRESTClient properties such as the HTTP connection and receive timeouts - increase them...