Skip to content

Commit

Permalink
Enable zstd compression (karafka#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmartens authored Sep 27, 2020
1 parent 23863c5 commit 532afaa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
16 changes: 4 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: ruby

sudo: false
dist: bionic
os: linux

services:
- docker
Expand All @@ -22,16 +22,8 @@ rvm:
before_install:
- gem update --system
- |
r_eng="$(ruby -e 'STDOUT.write RUBY_ENGINE')";
if [ "$r_eng" == "jruby" ]; then
sudo apt-get update && \
sudo apt-get install -y git && \
sudo apt-get install -y libpthread-stubs0-dev && \
sudo apt-get install -y build-essential && \
sudo apt-get install -y zlib1g-dev && \
sudo apt-get install -y libssl-dev && \
sudo apt-get install -y libsasl2-dev
fi
sudo apt-get update && \
sudo apt-get install -y git build-essential libpthread-stubs0-dev zlib1g-dev libzstd-dev libssl-dev libsasl2-dev
before_script:
- docker-compose up -d
Expand Down
2 changes: 1 addition & 1 deletion ext/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace :build do

recipe = MiniPortile.new("librdkafka", version)
recipe.files << "https://github.com/edenhill/librdkafka/archive/#{ref}.tar.gz"
recipe.configure_options = ["--host=#{recipe.host}"]
recipe.configure_options = ["--host=#{recipe.host}","--enable-static", "--enable-zstd"]
recipe.cook

ext = recipe.host.include?("darwin") ? "dylib" : "so"
Expand Down
6 changes: 6 additions & 0 deletions spec/rdkafka/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@
}.to raise_error(Rdkafka::Config::ConfigError, "No such configuration property: \"invalid.key\"")
end

it "should allow configuring zstd compression" do
config = Rdkafka::Config.new('compression.codec' => 'zstd')
expect(config.producer).to be_a Rdkafka::Producer
config.producer.close
end

it "should raise an error when client creation fails for a consumer" do
config = Rdkafka::Config.new(
"security.protocol" => "SSL",
Expand Down

0 comments on commit 532afaa

Please sign in to comment.