For use in an input plugin 'b' should be written into 
pipeline.PipelinePack.MsgBytes and the pack should be sent to a ProtobufDecoder 
(which will perform the de-serialization below) 

Trink 

----- Original Message -----

> From: "David Birdsong" <[email protected]>
> To: "Michael Trinkala" <[email protected]>
> Cc: "heka" <[email protected]>
> Sent: Friday, January 31, 2014 11:35:05 PM
> Subject: Re: [heka] initializing msg from a Message.proto dumped string

> That is a quick way, thanks!
> On Jan 31, 2014 10:27 PM, "Michael Trinkala" < [email protected] > wrote:

> > import " code.google.com/p/goprotobuf/proto "
> 
> > import " github.com/mozilla-services/heka/message "
> 
> > b := // []byte value from your code
> 
> > msg := new(message.Message)
> 
> > err := proto.Unmarshal(b, msg)
> 

> > Trink
> 

> > > From: "David Birdsong" < [email protected] >
> > 
> 
> > > To: "heka" < [email protected] >
> > 
> 
> > > Sent: Friday, January 31, 2014 7:07:19 PM
> > 
> 
> > > Subject: [heka] initializing msg from a Message.proto dumped string
> > 
> 

> > > What's the easiest way to initialize a message that's been previously
> > > serialized? I'm writing an input module from kafka that takes care of
> > > message framing. So I've got a []byte value that could be directly
> > > instantiated into a message object. I'm looking at other input modules
> > > for
> > > an example, but so many of them deal with some sort of fd and parsing the
> > > input stream to fully build up a message object.
> > 
> 

> > > _______________________________________________
> > 
> 
> > > Heka mailing list
> > 
> 
> > > [email protected]
> > 
> 
> > > https://mail.mozilla.org/listinfo/heka
> > 
> 

> _______________________________________________
> Heka mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/heka
_______________________________________________
Heka mailing list
[email protected]
https://mail.mozilla.org/listinfo/heka

Reply via email to