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 -
Field Summary
Fields inherited from interface io.camunda.zeebe.gateway.impl.job.ActivateJobsHandler
ACTIVATE_JOBS_REQUEST_ID_GENERATOR -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(ActorControl actor) voidactivateJobs(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/#a2725e317ed87a9dstatic <T> LongPollingActivateJobsHandler.Builder<T>
-
Method Details
-
accept
-
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:
activateJobsin interfaceActivateJobsHandler<T>- Parameters:
request- The request to handle
-
newBuilder
-