Protos in activities arguments


We were updating temporal version SDK from 0.27 to 0.29 but had issues with arguments passed to activities. Seems that passing pointers of proto messages with enums is not able to encode / decode.

protoc versions for ref:

protoc-gen-go v1.20.0
protoc v3.11.4

Seems the ProtoJSONPayloadConverter used is using jsonpb ( ) which is deprecated in favor of protojson ( )

We’ve created a Converter to use protojson and seems to be working for now. Couldn’t find any issues on github about this. If protojson support will be added, please inform the ticket so we can revert to the default DataConvert again.

Best regards,
Pedro Almeida

1 Like

Hi Pedro.
First of all, we don’t use and if you follow “go to declaration” links in Go SDK you will see that is actually used as all our go wrappers for proto are generated using gogo. I did some performance comparison and according to it and overall convenience that gogo provides we don’t plan to switch to google version of protobuf in near future.
I also added unit test to test how enums are serialized inside proto objects. They are passed and enums seems to work fine.
My guess would be that you use google/progobuf library to generate your go proto objects and they can’t be serialized with our gogo based serializer. Can you confirm this?

Hello Alex,

Thanks for the reply. Indeed, i didn’t noticed the gogo in the path. My bad.

We generate our proto objects with protoc-gen-go version 1.20.
( )

Not sure this answer your question. Not familiar with google/progobuf.

We have this on the top of the generated objects :

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.20.0
// protoc v3.11.4

Is this enough?

Yes, this is google version and apparently structs are generated by it is not supported by gogo serializer. I see two possible solutions here:

  1. Create your custom payload converter and build your custom data converter using NewCompositeDataConverter: (apparently this is what you did).
  2. Switch to gogo to generate your go code.

We might add support for google version later.

Hi Alex,

Thanks for looking into it.

Indeed, we created a custom payload Converter and for now seems to be working fine.

If we have issues, will eval gogo as suggested.

Thanks again.