C# Класс KafkaNet.Protocol.Message

Message represents the data from a single event occurance.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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