Uploaded image for project: 'Spring AMQP'
  1. Spring AMQP
  2. AMQP-583

Consider root cause of MethodArgumentNotValidException as also fatal in ConditionalRejectingErrorHandler.DefaultExceptionStrategy

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 1.5.4
    • Fix Version/s: 1.6 M2, 1.5.5
    • Component/s: Core
    • Labels:

      Description

      As per the post in the reference URL, I noticed that when you use an annotated message listener with an @Valid annotation on its @Payload parameter and pass in an invalid message it's simply being requeued. This causes the same invalid message to be received over and over again, which is weird: since it's clearly the message payload itself that's causing the exception here, I would expect the default FatalExceptionStrategy to consider the resulting MethodArgumentNotValidException as fatal as well, in addition to the MessageConversionException that's already considered fatal. It's not like a redelivery might have a different result, as this is a non-transient error.

      Also, I think that the ConditionalRejectingErrorHandler.DefaultExceptionStrategy shouldn't log a stack trace before returning true, since that exception will have been logged by the ConditionalRejectingErrorHandler already and there's no point in logging it twice.

        Attachments

          Activity

            People

            • Assignee:
              grussell Gary Russell
              Reporter:
              jkuipers Joris Kuipers
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: