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

MutableMessageHeaders no longer supports serialized UUID

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 5.0.3
    • Fix Version/s: 5.1 M1, 5.0.4
    • Component/s: Core
    • Labels:

      Description

      The following code throws a java.lang.String cannot be cast to java.util.UUID exception in SI v5 (it didn't in SI v4). The root cause is specifically the commit in the JIRA "Reference URL".

      This situation will arise any time a message is being serialized – the UUID field nicely serializes to a String, but no longer serializes back.

      I believe the fix is as simple as doing a type check in the MutableMessageHeaders constructor: If the "id" header is a String, instantiate a UUID.

      Map<String, Object> myHeaders = new HashMap<>();
      myHeaders.put("id", "3a9d931f-f997-d5f1-6b57-749973b2cd7c");
      myHeaders.put("timestamp", 1521579328796L);
      new MutableMessageHeaders(myHeaders);
      

        Attachments

          Activity

            People

            • Assignee:
              abilan Artem Bilan
              Reporter:
              nathankurtyka Nathan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: