CodePudding user response:
CompletableFuture is not do this thingCodePudding user response:
Suggest not to import and do the data processing, import file exists on the file server, or will the parsed data exists in the database or redis, generated by the import file number, contain a timestamp, and then provide the front-end processing interface or timing task polling data processing and1, upload a file, parse the data, the database import table, generate fileNo, createTime and status (initial state is 0, pending), data can be found redis, key for fileNo
2, the front page provides query import untreated or process failure data in the table, can choose to deal with one of the import request or batch processing. Or by timing task processing, according to the createTime positive sequence processing, first create the first treatment, treatment success will import the status changed to 2 in the table, successful, otherwise into 1, deal with failure, next time continue to process,