On Wed, Mar 9, 2016 at 4:42 AM, Roberto Hashioka <
[email protected]> wrote:
> Hello,
>
> I'm using protobuf 2.6.1 with python and Kafka. When I send a message with
> the following format:
>
> message BaseEvent {
> required string trx_id = 1;
> required string source = 2;
> required int64 occur_time = 3;
> required EventType type = 4;
>
>
> message Actor {
> optional string user_id = 1;
> optional string remote_addr = 2;
> optional string remote_port = 3;
> optional string user_agent = 4;
> }
> }
>
> When I read from Kafka I do this:
>
> event = base_event_pb2.BaseEvent()
> event.ParseFromString(msg.value)
>
> I can read the fields such `trx_id` and `source`, but
> `event.Actor.user_id` is not readable, it's a <property at 0x7f0218077cb0>,
> `property` type.
>
> 1) Do I have to declare: optional Actor actor = 5; ?
>
Yes, otherwise there is no Actor field in BaseEvent.
> 2) If not, how can I convert to string the `property` event.Actor.user_id
> ?
>
> Thanks for the clarifications.
>
> Roberto
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.