This release mostly solves problems related to message deserialization and normalizes some of the naming conventions to ease during the upgrade to the upcoming 2.0 version.
Note: This release is the last release with ruby-kafka under the hood. We’ve already started the process of moving to rdkafka-ruby.
Note: If you are using Sidekiq-Backend plugin, please make sure that you’ve processed all the jobs from your Sidekiq queue before upgrading Karafka gems.
consumer#metadata is now consumer#batch_metadataThis change is trivial: if you use batch consuming mode and you use the Consumer#metadata method, replace it with Consumer#batch_metadata.
# Karafka 1.3 class UsersConsumerMessage
metadata available under#metadatamethodUp to version
1.3, all the message metadata would be directly available under the root scope of theparamsobject using both direct method reference as well as with#[]accessor.While it felt like “The Rails way”, it had several side-effects, amongst which the biggest were the need of having a hash like API, issues with accessing metadata without payload deserialization, and a lack of clear separation between payload and the metadata.
From now on, you can use the
params.metadataobject to fetch all the metadata.Note: we’ve preserved the direct metadata values fetching from the
paramsobject to preserve backwards compatibility.Message metadata access allowed without message deserialization
When accessing metadata, the payload is not being deserialized until
#payloadmethod is being used.null message support in the default JSON deserializer
When the Kafka message payload is
null/nil, deserialization won’t fail. Support for it was added as some of the Karafka users use log compaction with anilpayload. In case like that,#payloadwill returnnil.
Karafka::Params::Paramsno longer inherits from aHash
Karafka::Params::Paramsis now just a struct. This change is introduced to normalize the setup, limit the corner cases and simplify the interface only to methods that are really needed.Documentation
Our Wiki has been updated accordingly to the
1.4status. Please notify us if you find any incompatibilities.Getting started with Karafka
If you want to get started with Kafka and Karafka as fast as possible, then the best idea is to just clone our example repository:
git clone https://github.com/karafka/example-app ./example_appthen, just bundle install all the dependencies:
and follow the instructions from the example app Wiki.
The post Karafka framework 1.4.0 Release Notes (Ruby + Kafka) appeared first on Running with Ruby.
On October 23rd, we announced the beta availability of silicon-optimized AI models in Ubuntu. Developers…
At NVIDIA GTC Washington D.C., Canonical is pleased to support the arrival of the NVIDIA…
How Anbox Cloud streamlines localization testing Wherever users are based, they expect apps to just…
Ubuntu now runs natively on the Thundercomm RUBIK Pi 3 developer board – a lightweight…
Validate your skills and advance your career with recognized qualifications from the publishers of Ubuntu…
This article demonstrates how to deploy Poweradmin to manage PowerDNS on Ubuntu VPS server. What…