Class LongPollingActivateJobsHandler<T>

java.lang.Object
io.camunda.zeebe.gateway.impl.job.LongPollingActivateJobsHandler<T>
All Implemented Interfaces:
ActivateJobsHandler<T>, Consumer<ActorControl>

public final class LongPollingActivateJobsHandler<T> extends Object implements ActivateJobsHandler<T>
Adds long polling to the handling of activate job requests. When there are no jobs available to activate, the response will be kept open.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields inherited from interface io.camunda.zeebe.gateway.impl.job.ActivateJobsHandler

    ACTIVATE_JOBS_REQUEST_ID_GENERATOR
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    activateJobs(BrokerActivateJobsRequest request, ResponseObserver<T> responseObserver, Consumer<Runnable> setCancelHandler, long requestTimeout)
    +--------------------------------------------------------------------------------+ | BROKER(s) | +--------|-------------------------------^---------------------------------------+ | | +-----------+ +-------------------------------------|-------------------------------|--------------------------------------------------------------------------------+ | | | | GATEWAY | Activate commands/responses | | | | | | | | | | | | | | | | | | | | | | +-----------------------+ | +--------------------v-------------------+ No Jobs +-------------------------------+ | | --|------|---> Incoming Activate ----------|----------> Try to Activate on all partitions ------------| Handle No Jobs Activated | | | | | +-----------------------+ | +---------|----------^-------------------+ +-------/---------------|-------+ | | | | +------------------------+ | | | | | | | | +--------- Jobs available | | | / | | | | | | | Notification | | | +----------------v-----+ | | | | | | +------------------------+ | | +---->Complete Or Resubmit | | | | | | | | | | +-----|----------|-----+ | | | Client invalid input: '<'-|------|--------+--------------------------+----------------------+ | | | | | | | | | | | Received Jobs | | | | | | | | | | Handle Pending Requests | \ | | +--------v-------+ | Any request | | | | | | | Reached | | | Mark Pending | | contained | | | | +--------------------------+ | failure | | +----------------+ | resource exhausted | | | | | | threshold| | | | | | | | | | | | | | | | | | | |Retrieved | | | | | | | | |notify | | | | | | For all pending requests | | |in between | | | | | | +-------|--------------|-------+ | | | | | | +---------------------------------------> Internal Activate Jobs Retry invalid input: '<'--+ | | | | | +------------------------------+ | | | | | | | | |------|----------- | | +-----------+ | \------------------------------------- +------------------v-----+ | | Error \------------------------------------- | | | | \------------------- Resource Exhausted | | | | | | | +------------------------+ | | | | | | | +------------------------------------------------------------------------------------------------------------------------------------------------------+ https://textik.com/#a2725e317ed87a9d
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Consumer

    andThen
  • Method Details

    • accept

      public void accept(ActorControl actor)
      Specified by:
      accept in interface Consumer<T>
    • activateJobs

      public void activateJobs(BrokerActivateJobsRequest request, ResponseObserver<T> responseObserver, Consumer<Runnable> setCancelHandler, long requestTimeout)
      +--------------------------------------------------------------------------------+ | BROKER(s) | +--------|-------------------------------^---------------------------------------+ | | +-----------+ +-------------------------------------|-------------------------------|--------------------------------------------------------------------------------+ | | | | GATEWAY | Activate commands/responses | | | | | | | | | | | | | | | | | | | | | | +-----------------------+ | +--------------------v-------------------+ No Jobs +-------------------------------+ | | --|------|---> Incoming Activate ----------|----------> Try to Activate on all partitions ------------| Handle No Jobs Activated | | | | | +-----------------------+ | +---------|----------^-------------------+ +-------/---------------|-------+ | | | | +------------------------+ | | | | | | | | +--------- Jobs available | | | / | | | | | | | Notification | | | +----------------v-----+ | | | | | | +------------------------+ | | +---->Complete Or Resubmit | | | | | | | | | | +-----|----------|-----+ | | | Client invalid input: '<'-|------|--------+--------------------------+----------------------+ | | | | | | | | | | | Received Jobs | | | | | | | | | | Handle Pending Requests | \ | | +--------v-------+ | Any request | | | | | | | Reached | | | Mark Pending | | contained | | | | +--------------------------+ | failure | | +----------------+ | resource exhausted | | | | | | threshold| | | | | | | | | | | | | | | | | | | |Retrieved | | | | | | | | |notify | | | | | | For all pending requests | | |in between | | | | | | +-------|--------------|-------+ | | | | | | +---------------------------------------> Internal Activate Jobs Retry invalid input: '<'--+ | | | | | +------------------------------+ | | | | | | | | |------|----------- | | +-----------+ | \------------------------------------- +------------------v-----+ | | Error \------------------------------------- | | | | \------------------- Resource Exhausted | | | | | | | +------------------------+ | | | | | | | +------------------------------------------------------------------------------------------------------------------------------------------------------+ https://textik.com/#a2725e317ed87a9d
      Specified by:
      activateJobs in interface ActivateJobsHandler<T>
      Parameters:
      request - The request to handle
    • newBuilder

      public static <T> LongPollingActivateJobsHandler.Builder<T> newBuilder()