ruby-kafka

https://github.com/zendesk/ruby-kafka

Ruby

A Ruby client library for Apache Kafka

Kafka::Protocol::Message#correct_offsets

Offsets may be relative with regards to wrapped message offset, but there are special cases.

Cases when client will receive corrected offsets:
  - When fetch request is version 0, kafka will correct relative offset on broker side before replying fetch response
  - When messages is stored in 0.9 format on disk (broker configured to do so).

All other cases, compressed inner messages should have relative offset, with below attributes:
  - The container message should have the 'real' offset
  - The container message's offset should be the 'real' offset of the last message in the compressed batch

Source | Google | Stack overflow

Edit

git clone [email protected]:zendesk/ruby-kafka.git

cd ruby-kafka

open lib/kafka/protocol/message.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Kafka--Protocol--Message-correct_offsets-for-pr


# Commit to git

git add lib/kafka/protocol/message.rbgit commit -m "better docs for Kafka::Protocol::Message#correct_offsets"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Kafka--Protocol--Message-correct_offsets-for-pr

hub pull-request


# Celebrate!