JeffKing54
JeffKing54

Reputation: 21

Using Protobuf messages in a Pcollection in Apache Beam using Go causing an error

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

Upvotes: 0

Views: 564

Answers (1)

Jaroslaw
Jaroslaw

Reputation: 656

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

Upvotes: 1

Related Questions