Interface JobWorkerBuilderStep1.JobWorkerBuilderStep2

    • Method Detail

      • handler

        JobWorkerBuilderStep1.JobWorkerBuilderStep3 handler​(JobHandler handler)
        Set the handler to process the jobs. At the end of the processing, the handler should complete the job or mark it as failed;

        Example JobHandler implementation:

         public final class PaymentHandler implements JobHandler
         {
           @Override
           public void handle(JobClient client, JobEvent jobEvent)
           {
             String json = jobEvent.getVariables();
             // modify variables
        
             client
              .newCompleteCommand(jobEvent.getKey())
              .variables(json)
              .send();
           }
         };
         
        The handler must be thread-safe.
        Parameters:
        handler - the handle to process the jobs
        Returns:
        the builder for this worker