...
This is a notation for handling repeated structures. These will always be encoded as an int32 size containing the length N followed by N repetitions of the structure which can itself be made up of other primitive types. In the BNF grammars below we will show an array of a structure foo as [foo].
Optional entries
Certain fields may be present under certain conditions (say if there is no error). These are represented as |foo|.
Notes on reading the request format grammars
...
These APIs allow for centralized management of offsets. Read more Offset Management. As per comments on KAFKA-993 these API calls are not fully functional in releases until Kafka 0.8 and .1.1. It will be implemented in a future versionavailable in the 0.8.2 release.
Consumer Metadata Request
...
Consumer Metadata Response
On a successful (ErrorCode == 0
) response, the coordinator fields provide the id/host/port details of the offset coordinator.
Code Block |
---|
ConsumerMetadataResponse => ErrorCode [|CoordinatorId CoordinatorHost CoordinatorPort]| ErrorCode => int16 CoordinatorId => int32 CoordinatorHost => string CoordinatorPort => int32 |
...
Code Block |
---|
OffsetCommitRequest => ConsumerGroup [TopicName [Partition Offset TimeStamp Metadata]] ConsumerGroup => string TopicName => string Partition => int32 Offset => int64 MetadataTimeStamp => string |
Offset Commit Response
Code Block |
---|
OffsetCommitResponseint64 Metadata => string |
(If the time stamp field is set to -1, then the broker sets the time stamp to the receive time before committing the offset.)
Offset Commit Response
Code Block |
---|
OffsetCommitResponse => [TopicName [Partition ErrorCode]]] [TopicName [Partition ErrorCode]]] TopicName => string Partition => int32 ErrorCode => int16 |
...
Code Block |
---|
OffsetFetchResponse => [TopicName [Partition Offset Metadata ErrorCode]] TopicName => string Partition => int32 Offset => int64 Metadata => string ErrorCode => int16 |
Constants
Api Keys
Note that if there is no offset associated with a topic-partition under that consumer group the broker does not set an error code (since it is not really an error), but returns empty metadata and sets the offset field to -1.
Constants
Api Keys
The following are the numeric codes that the ApiKey The following are the numeric codes that the ApiKey in the request can take for each of the above request types.
...
Error | Code | Description |
---|---|---|
NoError | 0 | No error--it worked! |
Unknown | -1 | An unexpected server error |
OffsetOutOfRange | 1 | The requested offset is outside the range of offsets maintained by the server for the given topic/partition. |
InvalidMessage | 2 | This indicates that a message contents does not match its CRC |
UnknownTopicOrPartition | 3 | This request is for a topic or partition that does not exist on this broker. |
InvalidMessageSize | 4 | The message has a negative size |
LeaderNotAvailable | 5 | This error is thrown if we are in the middle of a leadership election and there is currently no leader for this partition and hence it is unavailable for writes. |
NotLeaderForPartition | 6 | This error is thrown if the client attempts to send messages to a replica that is not the leader for some partition. It indicates that the clients metadata is out of date. |
RequestTimedOut | 7 | This error is thrown if the request exceeds the user-specified time limit in the request. |
BrokerNotAvailable | 8 | This is not a client facing error and is used only internally by intra-cluster broker communication. |
Unused | 9 | Unused |
MessageSizeTooLarge | 10 | The server has a configurable maximum message size to avoid unbounded memory allocation. This error is thrown if the client attempt to produce a message larger than this maximum. |
StaleControllerEpochCode | 11 | Internal error code for broker-to-broker communication. |
OffsetMetadataTooLargeCode | 12 | If you specify a string larger than configured maximum for offset metadata |
OffsetsLoadInProgressCode | 14 | The broker returns this error code for an offset fetch request if it is still loading offsets (after a leader change for that offsets topic partition). |
ConsumerCoordinatorNotAvailableCode | 15 | The broker returns this error code for consumer metadata requests or offset commit requests if the offsets topic has not yet been created. |
NotCoordinatorForConsumerCode | 16 | The broker returns this error code if it receives an offset fetch or commit request for a consumer group that it is not a coordinator for. |
Some Common Philosophical Questions
...