1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

kafka convert json to producer message.

This commit is contained in:
winlin 2015-10-23 10:16:53 +08:00
parent 8e344f1c26
commit 76cd3f8749
2 changed files with 115 additions and 9 deletions

View file

@ -79,6 +79,7 @@ public:
virtual bool null();
virtual bool empty();
virtual std::string to_str();
virtual void set_value(std::string v);
// interface ISrsCodec
public:
virtual int nb_bytes();
@ -103,6 +104,8 @@ public:
public:
virtual bool null();
virtual bool empty();
virtual void set_value(std::string v);
virtual void set_value(const char* v, int nb_v);
// interface ISrsCodec
public:
virtual int nb_bytes();
@ -531,6 +534,16 @@ public:
public:
SrsKafkaRawMessage();
virtual ~SrsKafkaRawMessage();
public:
/**
* create message from json object.
*/
virtual int create(SrsJsonObject* obj);
private:
/**
* get the raw message, bytes after the message_size.
*/
virtual int raw_message_size();
// interface ISrsCodec
public:
virtual int nb_bytes();
@ -768,7 +781,7 @@ public:
*/
class SrsKafkaProducerRequest : public SrsKafkaRequest
{
private:
public:
/**
* This field indicates how many acknowledgements the servers should receive
* before responding to the request. If it is 0 the server will not send any