private void executeJob(ActivatedJob job, Runnable doneCallback) { try { handler.handle(jobClient, job); } catch (Exception e) { LOG.warn( "Worker {} failed to handle job with key {} of type {}, sending fail command to broker", job.getWorker(), job.getKey(), job.getType(), e); jobClient .newFailCommand(job.getKey()) .retries(job.getRetries() - 1) .errorMessage(e.getMessage()) .send(); } finally { doneCallback.run(); } } }
private void executeJob(ActivatedJob job, Runnable doneCallback) { try { handler.handle(jobClient, job); } catch (Exception e) { LOG.warn( "Worker {} failed to handle job with key {} of type {}, sending fail command to broker", job.getWorker(), job.getKey(), job.getType(), e); jobClient .newFailCommand(job.getKey()) .retries(job.getRetries() - 1) .errorMessage(e.getMessage()) .send(); } finally { doneCallback.run(); } } }