Skip to content

Commit

Permalink
NIFI-13991 Fix GetAwsTextractJobStatus so that a ProvisionedThroughpu…
Browse files Browse the repository at this point in the history
…tExceededException properly sends the flowfile to the "throttled" relationship.

This closes #9510.

Signed-off-by: Peter Turcsanyi <[email protected]>
  • Loading branch information
tpalfy authored and exceptionfactory committed Nov 12, 2024
1 parent 252e872 commit a5807cb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.amazonaws.services.textract.model.GetDocumentTextDetectionRequest;
import com.amazonaws.services.textract.model.GetExpenseAnalysisRequest;
import com.amazonaws.services.textract.model.JobStatus;
import com.amazonaws.services.textract.model.ProvisionedThroughputExceededException;
import com.amazonaws.services.textract.model.ThrottlingException;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -96,8 +97,9 @@ public void onTrigger(ProcessContext context, ProcessSession session) throws Pro
session.transfer(flowFile, REL_FAILURE);
getLogger().error("Amazon Textract Task [{}] Failed", awsTaskId);
}
} catch (ThrottlingException e) {
} catch (ThrottlingException | ProvisionedThroughputExceededException e) {
getLogger().info("Request Rate Limit exceeded", e);
context.yield();
session.transfer(flowFile, REL_THROTTLED);
return;
} catch (Exception e) {
Expand Down

0 comments on commit a5807cb

Please sign in to comment.