Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-5967

ProtoCoder doesn't support DynamicMessage

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.0
    • Fix Version/s: 2.17.0
    • Component/s: sdk-java-core
    • Labels:
      None

      Description

      The ProtoCoder does make some assumptions about static messages being available. The DynamicMessage doesn't have some of them, mainly because the proto schema is defined at runtime and not at compile time.

      Does it make sense to make a special coder for DynamicMessage or build it into the normal ProtoCoder.

      Here is an example of the assumtion being made in the current Codec:

      try {
        @SuppressWarnings("unchecked")
        T protoMessageInstance = (T) protoMessageClass.getMethod("getDefaultInstance").invoke(null);
        @SuppressWarnings("unchecked")
        Parser<T> tParser = (Parser<T>) protoMessageInstance.getParserForType();
        memoizedParser = tParser;
      } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
        throw new IllegalArgumentException(e);
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alexvanboxel Alex Van Boxel
                Reporter:
                alexvanboxel Alex Van Boxel
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 8.5h
                  8.5h