春季批處理作業運行完成成功地與下面的代碼:春季招聘響應客戶
@RestController
@RequestMapping(value = "api/jobs")
public class JobLaunchingController {
@Autowired
private JobOperator jobOperator;
@RequestMapping(value = "/pay/{paymentPeriod}", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.ACCEPTED)
public void launchPaymentJob(@PathVariable Integer paymentPeriod) throws Exception {
this.jobOperator.start("paymentJob", String.format("paymentPeriod=%s,time=" + System.currentTimeMillis(), paymentPeriod));
}
}
我使用JavaFX客戶端點被用於爲作業發送請求被啓動。基本上,Jersey客戶端的HTTP請求的幫助下被送到像這樣
Client client = ClientBuilder.newBuilder().build();
WebTarget webTarget = client.target(getBaseUri()).path(path);
Response response = webTarget.request().get(Response.class);
問題是我沒有辦法讓客戶知道作業完成時。當作業完成後,客戶如何通過服務器通知
任何幫助都非常感謝。
你已經嘗試了您的應用程序的JMS? –
你可以發送一個簡單的電子郵件,或者可以在你的代碼中實現jms,或者你可以使用firebase –
如果它幫助你,請不要忘記接受/提出答案...... – Cepr0