Exist-db parallel request(bulk request) failed on exist db restxq (post,put)

64 views Asked by At

I am facing a problem on restxq multiple parallel request of post, put. When request from web application as async bulk request (approx. more then 5 ). I am using exist db 5.1.0 or 5.1.1 I am sending request through angular forkjoin because of i want to submit more then 20 or 50 request in parallel

declare
%rest:path("/docs/{$doc-id}")
%rest:PUT("{$body}")
%rest:consumes("application/json")
%output:method("json")
function doc-rx:update-docs($doc-id as xs:string, $body) {
  try{
    let $request:= parse-json(util:binary-to-string( $body))
    return
   <result>Success</result>
  }catch * {
   <error>Caught error {$err:description}</error>
 }
};

Some request will failed with below message, some request got cancelled

Failed Message: The underlying InputStream has been closed. Unable to encode string value: The underlying InputStream has been closed Some Request got cancelled.

Please advise how can I resolve this issue.

0

There are 0 answers