use of io.zeebe.protocol.clientapi.MessageHeaderDecoder in project zeebe by zeebe-io.
the class ClientApiRule method isMessageOfType.
protected boolean isMessageOfType(DirectBuffer message, int type) {
final MessageHeaderDecoder headerDecoder = new MessageHeaderDecoder();
headerDecoder.wrap(message, 0);
return headerDecoder.templateId() == type;
}
use of io.zeebe.protocol.clientapi.MessageHeaderDecoder 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