use of io.zeebe.protocol.clientapi.ErrorCode in project zeebe by zeebe-io.
the class RequestManager method shouldRetryRequest.
private static boolean shouldRetryRequest(DirectBuffer responseContent) {
final ErrorResponseHandler errorHandler = new ErrorResponseHandler();
final MessageHeaderDecoder headerDecoder = new MessageHeaderDecoder();
headerDecoder.wrap(responseContent, 0);
if (errorHandler.handlesResponse(headerDecoder)) {
errorHandler.wrap(responseContent, headerDecoder.encodedLength(), headerDecoder.blockLength(), headerDecoder.version());
final ErrorCode errorCode = errorHandler.getErrorCode();
return errorCode == ErrorCode.PARTITION_NOT_FOUND || errorCode == ErrorCode.REQUEST_TIMEOUT;
} else {
return false;
}
}
Aggregations