Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-1534

Header annotation on method does not work if header name contains a hyphen

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.0 M7
    • Fix Version/s: 2.0 RC1
    • Component/s: Core
    • Labels:
      None

      Description

      Since we are creating a SpEL expression that relies upon dot notation to access the name from the Map of MessageHeaders, if a name containing a hyphen is passed via @Header("foo-bar"), it will not create a valid expression (e.g. headers.foo-bar). We probably need to use the headers['foo-bar'] format at all times. The problem with that is that the current implementation is relying upon SpEL's failure via dot-notation property resolution for throwing the Exception when a "required" header is missing. That is probably not the ideal way to drive those errors however. Ideally, we should find a solution that addresses both issues without affecting any of the currently functioning behavior.

        Activity

        Hide
        mark.fisher Mark Fisher added a comment -

        See the 'source' tab for details on this change.

        Show
        mark.fisher Mark Fisher added a comment - See the 'source' tab for details on this change.
        Hide
        wims.tijd wims.tijd added a comment -
        Show
        wims.tijd wims.tijd added a comment - just added https://jira.springsource.org/browse/INT-1536 with test case,

          People

          • Assignee:
            mark.fisher Mark Fisher
            Reporter:
            mark.fisher Mark Fisher
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: