[ 
https://issues.apache.org/jira/browse/NIFI-3142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15946509#comment-15946509
 ] 

ASF GitHub Bot commented on NIFI-3142:
--------------------------------------

Github user klinvill commented on the issue:

    https://github.com/apache/nifi/pull/1290
  
    @jfrazee Apologies for the delayed response. I was running it against NiFi 
1.0.0. The client I was working for at the time was using a few non-standard 
HL7 messages that were resulting in exceptions. The exceptions weren't really 
the problem (the failed messages just require specialized processing). The real 
problem was that the exceptions thrown were not HL7Exceptions so the NiFi 
processor didn't know where to route the message and the flowfile stayed in the 
queue to be processed at a later time. We were handling a large volume of these 
messages so the processor quickly got overloaded with the flowfile backlog. We 
ended up fixing this locally by simply routing all exceptions to failure so 
that the flowfiles would be moved out of the queue. I understand @mattyb149's 
point about how catching all exceptions could lead to data loss. Unfortunately 
I no longer have access to the messages or workflows that are failing so I'll 
go ahead and close this request. Thank you all for the help, if I run into this 
situation again I'll add in additional business logic and submit it back as a 
pull request.


> ExtractHL7Attributes processor does not route to REL_FAILURE for an exception 
> other than an HL7Exception
> --------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-3142
>                 URL: https://issues.apache.org/jira/browse/NIFI-3142
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.0.0
>            Reporter: Kirby Linvill
>            Priority: Minor
>              Labels: easyfix
>
> The ExtractHL7Attribute processor will not route a flowfile to REL_FAILURE if 
> processing the flow file throws an exception that is not an HL7Exception. 
> This bug is a result of the try catch block in the onTrigger method. It is 
> easily fixed by changing the catch block to catch a throwable object. Change
> {noformat} 
> try {
>     ...
> } catch (final HL7Exception e) {
>     getLogger().error("Failed to extract attributes from {} due to {}", new 
> Object[]{flowFile, e}, e);
>     session.transfer(flowFile, REL_FAILURE);
>     return;
> }
> {noformat} 
> to 
> {noformat} 
> try {
>     ...
> } catch (final Throwable t) {
>     getLogger().error("Failed to extract attributes from {} due to {}", new 
> Object[]{flowFile, t}, t);
>     session.transfer(flowFile, REL_FAILURE);
>     return;
> }
> {noformat} 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to