0
func processPubSubMsgFn(ctx context.Context, in *pubsub.PubsubMessage) v1.someProto {
    someProto := &v1.someProto{}
    if err := proto.Unmarshal((in.Data), someProto); err != nil {
        log.Fatalln("Failed to parse address book:", err)
    }
    return *someProto
}

Causes: bad return type caused by: encoding struct v1.someProto type has unexported field: state

When trying to run the pipeline, In java I would set the coder for the message type, not sure how to do this in the Go Version of Apache Beam

1
  • I had to add beam.RegisterType(reflect.TypeOf(v1. someProto{})) to the init() function. Commented Aug 9, 2021 at 13:01

1 Answer 1

1

From what i see in apache beam sdk you should return *v1.someProto instead of v1.someProto.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the help, yes you are correct that worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.