use template in protobuf callback