C# 클래스 KafkaNet.Protocol.Message

Message represents the data from a single event occurance.
파일 보기 프로젝트 열기: gigya/KafkaNetClient 1 사용 예제들

공개 메소드들

메소드 설명
DecodeMessage ( long offset, byte payload ) : IEnumerable

Decode messages from a payload and assign it a given kafka offset.

The return type is an Enumerable as the message could be a compressed message set.

DecodeMessageSet ( byte messageSet ) : IEnumerable

Decode a byte[] that represents a collection of messages.

EncodeMessage ( Message message ) : byte[]

Encodes a message object to byte[]

Format: Crc (Int32), MagicByte (Byte), Attribute (Byte), Key (Byte[]), Value (Byte[])

EncodeMessageSet ( IEnumerable messages ) : byte[]

Encodes a collection of messages into one byte[]. Encoded in order of list.

Message ( ) : KafkaNet.Common

Construct an empty message.

Message ( string value, string key = null ) : KafkaNet.Common

Convenience constructor will encode both the key and message to byte streams. Most of the time a message will be string based.

메소드 상세

DecodeMessage() 공개 정적인 메소드

Decode messages from a payload and assign it a given kafka offset.
The return type is an Enumerable as the message could be a compressed message set.
public static DecodeMessage ( long offset, byte payload ) : IEnumerable
offset long The offset represting the log entry from kafka of this message.
payload byte The byte[] encode as a message from kafka.
리턴 IEnumerable

DecodeMessageSet() 공개 정적인 메소드

Decode a byte[] that represents a collection of messages.
public static DecodeMessageSet ( byte messageSet ) : IEnumerable
messageSet byte The byte[] encode as a message set from kafka.
리턴 IEnumerable

EncodeMessage() 공개 정적인 메소드

Encodes a message object to byte[]
Format: Crc (Int32), MagicByte (Byte), Attribute (Byte), Key (Byte[]), Value (Byte[])
public static EncodeMessage ( Message message ) : byte[]
message Message Message data to encode.
리턴 byte[]

EncodeMessageSet() 공개 정적인 메소드

Encodes a collection of messages into one byte[]. Encoded in order of list.
public static EncodeMessageSet ( IEnumerable messages ) : byte[]
messages IEnumerable The collection of messages to encode together.
리턴 byte[]

Message() 공개 메소드

Construct an empty message.
public Message ( ) : KafkaNet.Common
리턴 KafkaNet.Common

Message() 공개 메소드

Convenience constructor will encode both the key and message to byte streams. Most of the time a message will be string based.
public Message ( string value, string key = null ) : KafkaNet.Common
value string The main content data of this message.
key string The key value for the message. Can be null.
리턴 KafkaNet.Common