Skip to content

Commit

Permalink
nifi-1509 catch recoverable service exceptions explicity
Browse files Browse the repository at this point in the history
  • Loading branch information
mans2singh committed Feb 12, 2016
1 parent cd05bed commit 528c4bc
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,19 @@ public void onTrigger(final ProcessContext context, final ProcessSession session
new Object[]{functionName, unrecoverableException, flowFile});
flowFile = populateExceptionAttributes(session, flowFile, unrecoverableException);
session.transfer(flowFile, REL_FAILURE);
} catch (final ServiceException | TooManyRequestsException exception) {
} catch (final TooManyRequestsException retryableServiceException) {
getLogger().error("Failed to invoke lambda {} with exception {} for flow file {}, therefore penalizing flowfile",
new Object[]{functionName, exception, flowFile});
flowFile = populateExceptionAttributes(session, flowFile, exception);
new Object[]{functionName, retryableServiceException, flowFile});
flowFile = populateExceptionAttributes(session, flowFile, retryableServiceException);
flowFile = session.penalize(flowFile);
session.transfer(flowFile, REL_FAILURE);
context.yield();
} catch (final AmazonServiceException unrecoverableServiceException) {
getLogger().error("Failed to invoke lambda {} with exception {} for flow file {} sending to fail",
new Object[]{functionName, unrecoverableServiceException, flowFile});
flowFile = populateExceptionAttributes(session, flowFile, unrecoverableServiceException);
session.transfer(flowFile, REL_FAILURE);
context.yield();
} catch (final Exception exception) {
getLogger().error("Failed to invoke lambda {} with exception {} for flow file {}",
new Object[]{functionName, exception, flowFile});
Expand Down

0 comments on commit 528c4bc

Please sign in to comment.