protected FieldDescriptor resolvePayloadField ( Message message ) { for ( FieldDescriptor field : message . getDescriptorForType ( ) . getFields ( ) ) { if ( message . hasField ( field ) ) { return field ; } } throw new RuntimeException ( "No payload found in message " + message ) ; }
Find out which field in the incoming message contains the payload that is . delivered to the service method .