Asynchronous Document Upload
Monday, August 14, 2017 at 08:34amApologies if this is a duplicate. I may have trashed the last thread accidentally.
Hello everyone,
We've been seeing errors uploading documents asynchronously using jar with dependencies 11.0.2.
com.silanis.esl.sdk.EslException: Could not upload document to package.
at com.silanis.esl.sdk.service.PackageService.uploadApiDocument(PackageService.java:361)
at com.silanis.esl.sdk.service.PackageService.uploadDocument(PackageService.java:344)
at com.silanis.esl.sdk.EslClient.uploadDocument(EslClient.java:636)
at com.silanis.esl.sdk.EslClient.uploadDocument(EslClient.java:648)
Caused by: java.lang.IllegalArgumentException: id parameter cannot be null or empty
at com.silanis.esl.sdk.DocumentId.(DocumentId.java:20)
//Async docsToCreate.parallelStream().forEach(doc -> uploadDocument(doc, createdPackage)); //Sync docsToCreate.stream().forEach(doc -> uploadDocument(doc, createdPackage)); private static void uploadDocument(Document doc, DocumentPackage pack){ System.out.println(">>> Uploading: " + doc.getName()); Date starttime = new Date(); eslClient.uploadDocument(doc, pack.getId()); Date endPackageBuildTime = new Date(); System.out.println( " Uploading took: " + new Long(endPackageBuildTime.getTime() - starttime.getTime()) + "ms FOR: " + doc.getName()); }Note: when using the Synchronous version, all documents upload successfully. I do not believe it is an issue with the package.
Reply to: Asynchronous Document Upload
Monday, August 14, 2017 at 11:25amReply to: Asynchronous Document Upload
Monday, August 14, 2017 at 09:42ameslClient.createPackageOneStep()
call. This will create a multipart/form-data request and upload all your documents in one request.Reply to: Asynchronous Document Upload
Monday, August 14, 2017 at 11:05amReply to: Asynchronous Document Upload
Monday, August 14, 2017 at 11:42am