Example usage for com.amazonaws AmazonClientException isRetryable

List of usage examples for com.amazonaws AmazonClientException isRetryable

Introduction

In this page you can find the example usage for com.amazonaws AmazonClientException isRetryable.

Prototype

@SdkInternalApi
public boolean isRetryable() 

Source Link

Document

Returns a hint as to whether it makes sense to retry upon this exception.

Usage

From source file:org.apache.nifi.processors.aws.dynamodb.AbstractDynamoDBProcessor.java

License:Apache License

protected List<FlowFile> processClientException(final ProcessSession session, List<FlowFile> flowFiles,
        AmazonClientException exception) {
    List<FlowFile> failedFlowFiles = new ArrayList<>();
    for (FlowFile flowFile : flowFiles) {
        Map<String, String> attributes = new HashMap<>();
        attributes.put(DYNAMODB_ERROR_EXCEPTION_MESSAGE, exception.getMessage());
        attributes.put(DYNAMODB_ERROR_RETRYABLE, Boolean.toString(exception.isRetryable()));
        flowFile = session.putAllAttributes(flowFile, attributes);
        failedFlowFiles.add(flowFile);/*ww w.  j av a 2 s .c om*/
    }
    return failedFlowFiles;
}