From c6871cd1f0ec3052383148be0194bed413a3b119 Mon Sep 17 00:00:00 2001 From: belltoy Date: Wed, 4 Jan 2023 15:23:10 +0800 Subject: [PATCH] Fix snappyer as optional dependency --- README.md | 16 +++++++++++++++- rebar.config | 6 +++--- rebar.lock | 9 +++------ src/brod.app.src | 2 +- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index c5b178b6..8a0751e9 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Why "brod"? [http://en.wikipedia.org/wiki/Max_Brod](http://en.wikipedia.org/wiki - Pick latest supported version when sending requests to kafka. - Direct APIs for message send/fetch and cluster inspection/management without having to start clients/producers/consumers. - A escriptized command-line tool for message send/fetch and cluster inspection/management. -- Configurable compression library. `snappy` compression is supported by default. +- Configurable compression library. No compression is supported by default for both producers and consumers. For more compression options, see [kafka_protocol/README](https://github.com/kafka4beam/kafka_protocol/blob/master/README.md#compression-support) ## Building and testing @@ -114,6 +114,20 @@ two-level supervision trees. To use producers or consumers, you have to start at least one client that will manage them. +### Compression + +Brod does not dependent on any compression/decompression implementation by default. +To enable them, you must add the compression application as dependency. + +For example: + +```erlang +% rebar.config +{deps, [ + {snappyer, "1.2.8"} +]. +``` + ### Start clients by default You may include client configs in `sys.config` have them started by default diff --git a/rebar.config b/rebar.config index 4637d1e4..b3871f26 100644 --- a/rebar.config +++ b/rebar.config @@ -1,6 +1,4 @@ -{deps, [ {kafka_protocol, "4.1.5"} - , {snappyer, "1.2.9"} - ]}. +{deps, [ {kafka_protocol, "4.1.5"} ]}. {project_plugins, [{coveralls, "~> 2.2.0"}, {rebar3_lint, "~> 1.0.2"}]}. {edoc_opts, [{preprocess, true}, {macros, [{build_brod_cli, true}]}]}. {erl_opts, [warnings_as_errors, warn_unused_vars,warn_shadow_vars,warn_obsolete_guard,debug_info]}. @@ -11,6 +9,7 @@ {brod_cli, [ {deps, [ {docopt, {git, "https://github.com/zmstone/docopt-erl.git", {branch, "0.1.3"}}} , {jsone, "1.7.0"} + , {snappyer, "1.2.8"} ]}, {erl_opts, [warnings_as_errors, {d, build_brod_cli}]}, {escript_name, brod_cli}, @@ -29,6 +28,7 @@ , {meck, "0.9.2"} , {proper, "1.4.0"} , {snabbkaffe, "1.0.1"} + , {snappyer, "1.2.8"} ]}, {erl_opts, [warnings_as_errors, {d, build_brod_cli}]} ]} diff --git a/rebar.lock b/rebar.lock index 0a925d0e..37f5d25b 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,14 +1,11 @@ {"1.2.0", [{<<"crc32cer">>,{pkg,<<"crc32cer">>,<<"0.1.8">>},1}, - {<<"kafka_protocol">>,{pkg,<<"kafka_protocol">>,<<"4.1.3">>},0}, - {<<"snappyer">>,{pkg,<<"snappyer">>,<<"1.2.9">>},0}]}. + {<<"kafka_protocol">>,{pkg,<<"kafka_protocol">>,<<"4.1.3">>},0}]}. [ {pkg_hash,[ {<<"crc32cer">>, <<"C6C2275C5FB60A95F4935D414F30B50EE9CFED494081C9B36EBB02EDFC2F48DB">>}, - {<<"kafka_protocol">>, <<"362D85A898D4148A43DBABB10A30BB2D6FF32BA0097EB06981D11B34E2E0A9CD">>}, - {<<"snappyer">>, <<"9CC58470798648CE34C662CA0AA6DAAE31367667714C9A543384430A3586E5D3">>}]}, + {<<"kafka_protocol">>, <<"362D85A898D4148A43DBABB10A30BB2D6FF32BA0097EB06981D11B34E2E0A9CD">>}]}, {pkg_hash_ext,[ {<<"crc32cer">>, <<"251499085482920DEB6C9B7AADABF9FB4C432F96ADD97AB42AEE4501E5B6F591">>}, - {<<"kafka_protocol">>, <<"28CF73001270D972524DD0FAD4A59074F4441219F9CF237AD808A2AC1EC97487">>}, - {<<"snappyer">>, <<"18D00CA218AE613416E6EECAFE1078DB86342A66F86277BD45C95F05BF1C8B29">>}]} + {<<"kafka_protocol">>, <<"28CF73001270D972524DD0FAD4A59074F4441219F9CF237AD808A2AC1EC97487">>}]} ]. diff --git a/src/brod.app.src b/src/brod.app.src index ccee3f48..656fb22a 100644 --- a/src/brod.app.src +++ b/src/brod.app.src @@ -3,7 +3,7 @@ [{description,"Apache Kafka Erlang client library"}, {vsn,"git"}, {registered,[]}, - {applications,[kernel,stdlib,kafka_protocol,snappyer]}, + {applications,[kernel,stdlib,kafka_protocol]}, {env,[]}, {mod, {brod, []}}, {modules,[]},