나는 스프링 배치 작업을 가지고 있습니다. Spring Batch를 처음 접했고 CommandLineJobRunner를 통해 항상 호출되었습니다.스프링 배치 - 웹 서비스로 호출
org.springframework.batch.core.launch.support.CommandLineJobRunner spring-batch-myProject.xml SpringJobBean.MyProjectImportDataJob
가 지금은 웹 서비스 (스프링 MVC) 내에서 내 일괄 작업을 호출 할 수 있습니다
이 내 전화는 모습입니다. 내 엔드 포인트에서 이것은 호출 호출입니다. if 문에서 배치 작업을 호출해야합니다. 어떻게하면 좋을까요? JobLauncher에 대해 읽었는데 ... 무엇을 출시 할지를 어떻게 말해야할지 모르겠습니다.
protected Object invokeInternal(Object aObj) throws Exception {
RunDataProcessingImportRequest request = (RunDataProcessingImportRequest) aObj;
RunDataProcessingImportResponse response = new RunDataProcessingImportResponse();
if (request.getDataProcessingType().equals(PROJECT_TYPE)){
response.setResultCd(1);
} else {
response.setResultCd(0);
response.setErrorCode(1l);
response.setErrorMessage("Incorrect process type");
}
return response;
}