Skip to content

Commit

Permalink
Fix snappyer as optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
belltoy committed Mar 8, 2024
1 parent 6dd0150 commit c6871cd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -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]}.
Expand All @@ -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},
Expand All @@ -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}]}
]}
Expand Down
9 changes: 3 additions & 6 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -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">>}]}
].
2 changes: 1 addition & 1 deletion src/brod.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -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,[]},
Expand Down

0 comments on commit c6871cd

Please sign in to comment.