Package io.camunda.zeebe.gateway
Class ResponseMapper
java.lang.Object
io.camunda.zeebe.gateway.ResponseMapper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontoActivatedJob(ActivatedJob brokerResponse) toActivateJobsResponse(JobActivationResponse activationResponse) While converting the broker response to the gRPC response, the response size is checked.toBroadcastSignalResponse(long key, SignalRecord brokerResponse) toCancelProcessInstanceResponse(long key, ProcessInstanceRecord brokerResponse) toCompleteJobResponse(long key, JobRecord brokerResponse) toCreateProcessInstanceResponse(long key, ProcessInstanceCreationRecord brokerResponse) toCreateProcessInstanceWithResultResponse(long key, ProcessInstanceResultRecord brokerResponse) toDeleteResourceResponse(long key, ResourceDeletionRecord brokerResponse) toDeployProcessResponse(long key, DeploymentRecord brokerResponse) toDeployResourceResponse(long key, DeploymentRecord brokerResponse) toEvaluateDecisionResponse(long key, DecisionEvaluationRecord brokerResponse) toFailJobResponse(long key, JobRecord brokerResponse) toMigrateProcessInstanceResponse(long key, ProcessInstanceMigrationRecord brokerResponse) toModifyProcessInstanceResponse(long key, ProcessInstanceModificationRecord brokerResponse) toPublishMessageResponse(long key, MessageRecord brokerResponse) toResolveIncidentResponse(long key, IncidentRecord incident) toSetVariablesResponse(long key, VariableDocumentRecord brokerResponse) toThrowErrorResponse(long key, JobRecord brokerResponse) toUpdateJobRetriesResponse(long key, JobRecord brokerResponse) toUpdateJobTimeoutResponse(long key, JobRecord brokerResponse)
-
Constructor Details
-
ResponseMapper
public ResponseMapper()
-
-
Method Details
-
toDeployProcessResponse
public static GatewayOuterClass.DeployProcessResponse toDeployProcessResponse(long key, DeploymentRecord brokerResponse) -
toDeployResourceResponse
public static GatewayOuterClass.DeployResourceResponse toDeployResourceResponse(long key, DeploymentRecord brokerResponse) -
toPublishMessageResponse
public static GatewayOuterClass.PublishMessageResponse toPublishMessageResponse(long key, MessageRecord brokerResponse) -
toUpdateJobRetriesResponse
public static GatewayOuterClass.UpdateJobRetriesResponse toUpdateJobRetriesResponse(long key, JobRecord brokerResponse) -
toUpdateJobTimeoutResponse
public static GatewayOuterClass.UpdateJobTimeoutResponse toUpdateJobTimeoutResponse(long key, JobRecord brokerResponse) -
toFailJobResponse
public static GatewayOuterClass.FailJobResponse toFailJobResponse(long key, JobRecord brokerResponse) -
toThrowErrorResponse
public static GatewayOuterClass.ThrowErrorResponse toThrowErrorResponse(long key, JobRecord brokerResponse) -
toCompleteJobResponse
public static GatewayOuterClass.CompleteJobResponse toCompleteJobResponse(long key, JobRecord brokerResponse) -
toCreateProcessInstanceResponse
public static GatewayOuterClass.CreateProcessInstanceResponse toCreateProcessInstanceResponse(long key, ProcessInstanceCreationRecord brokerResponse) -
toCreateProcessInstanceWithResultResponse
public static GatewayOuterClass.CreateProcessInstanceWithResultResponse toCreateProcessInstanceWithResultResponse(long key, ProcessInstanceResultRecord brokerResponse) -
toEvaluateDecisionResponse
public static GatewayOuterClass.EvaluateDecisionResponse toEvaluateDecisionResponse(long key, DecisionEvaluationRecord brokerResponse) -
toCancelProcessInstanceResponse
public static GatewayOuterClass.CancelProcessInstanceResponse toCancelProcessInstanceResponse(long key, ProcessInstanceRecord brokerResponse) -
toSetVariablesResponse
public static GatewayOuterClass.SetVariablesResponse toSetVariablesResponse(long key, VariableDocumentRecord brokerResponse) -
toActivateJobsResponse
public static JobActivationResult<GatewayOuterClass.ActivateJobsResponse> toActivateJobsResponse(JobActivationResponse activationResponse) While converting the broker response to the gRPC response, the response size is checked. If the response size exceeds the maximum response size, exceeding jobs are added to the list of exceeding jobs to be reactivated.This is because the jobs returned from the broker is in MessagePack format and while converting them to gRPC response the size of the response may increase (e.g. we do JSON and String conversions see:
toActivatedJob(long, JobRecord)). That will cause the response size to exceed the maximum response size allowed by the gateway and the gateway will log a Stream Error indicating that streaming out the activated jobs failed.If we do not respect the actual max response size, Zeebe Java Client rejects the response containing the activated jobs and the client cancels the channel/stream/connection as well. Leaving failed jobs non-activatable until their configured timeout.
- Parameters:
activationResponse- the response for job activation, containing the key of the request, the broker response, and the maximum size of the response- Returns:
- job activation result, allowing access to the response and a list of jobs that could not be included in the response because the response size exceeded the maximum response size
-
toActivatedJob
-
toResolveIncidentResponse
public static GatewayOuterClass.ResolveIncidentResponse toResolveIncidentResponse(long key, IncidentRecord incident) -
toModifyProcessInstanceResponse
public static GatewayOuterClass.ModifyProcessInstanceResponse toModifyProcessInstanceResponse(long key, ProcessInstanceModificationRecord brokerResponse) -
toMigrateProcessInstanceResponse
public static GatewayOuterClass.MigrateProcessInstanceResponse toMigrateProcessInstanceResponse(long key, ProcessInstanceMigrationRecord brokerResponse) -
toDeleteResourceResponse
public static GatewayOuterClass.DeleteResourceResponse toDeleteResourceResponse(long key, ResourceDeletionRecord brokerResponse) -
toBroadcastSignalResponse
public static GatewayOuterClass.BroadcastSignalResponse toBroadcastSignalResponse(long key, SignalRecord brokerResponse)
-