Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
jerownimow
Contributor III
Contributor III

How to have multiple response in one request?

I have a job that requires 2 responses, the structure is like this.

 

0683p000009M8RI.png

 

Can you help me figure out how can I facilitate these 2 succeeding responses?

Labels (3)
6 Replies
TRF
Creator III
Creator III

Try to send an interim response with code 102 for "Processing".
https://dret.typepad.com/dretblog/2007/11/one-request-mul.html
jerownimow
Contributor III
Contributor III
Author

Thanks for your reply. How can I configure it? Do I have to add two
tRESTResponse and one is configured with custom status code?
TRF
Creator III
Creator III

Yes, 2 tRESTResponse components.

For the status code, yes, select "<< custom >>" and enter 102 for the value, this the only way to use a status code which is not preconfigured into the component.

However I can't guarantee Talend authorize 2 responses for 1 request but it should as it is a standard behavior for REST services.

jerownimow
Contributor III
Contributor III
Author

Thank you for your inputs @TRF.

 

However, it didn't worked, I still got this error java.lang.RuntimeException: Rest response already sent.

TRF
Creator III
Creator III

My first reflex was to say it is not possible.
Then I saw a post regarding the proposed solution. Finally it seems this is not supported by tRESTResponse.
You may try with a piece of Java code to send code 101.
jerownimow
Contributor III
Contributor III
Author

Unfortunately, I'm not good with Java, can you give me a suggestion how to do it? I'm trying to google it but I can't seem to find one.