How to handle timeout on providing REST webservice

2
Hi, My app is a provider of many REST webservices. In case it takes more than x amount of seconds to finalize the microflow handling the webservice a timeout occurs. I get errors like "Failed to serve POST retrievedata: org.eclipse.jetty.io.EofException" on node "RestPublish" and "java.lang.IllegalStateException: Committed" of lognode "Connector". In this microflow I collect and store statistics and other data in the database, however the total transaction is rolled back. Using the StartTransaction and EndTransation Java actions from Community Commons do not solve my problem. Can I prevent or change the timeouts? Where can I handle the timeout exception to add my own error handling and prevent the rollback? I do not want to prevent timeouts but I want to be able to handle them properly. Regards, Paul
asked
1 answers
0

Timeouts are determined by infrastructure and clients making requests. As server you are not notified of such an event, but if it happens, you cannot write your data through the stream, and that probably results in the error you see. Besides that, you shouldn't need to 'handle' that exception, because the request was made and you should process is, whether the client has awaited the result or not.

So, is there anything that breaks here server side, or did you just get the exception but further everything worked as intended?

answered