Skip to content

Commit 719bc82

Browse files
committed
compression example#2
1 parent 73b478b commit 719bc82

6 files changed

+23
-5
lines changed

README.adoc

+13-1
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ This example will show that messages sent to the same topic with different _comp
539539
540540
Compressions supported on producer side are:
541541
542+
- none (no compression)
542543
- gzip
543544
- snappy
544545
- lz4
@@ -551,7 +552,13 @@ Bootstrap:
551552
scripts/bootstrap.sh
552553
----
553554
554-
Send messages with different compression type:
555+
Send messages with different compression type and with batching disabled:
556+
557+
[source,bash]
558+
----
559+
kafka-console-producer --broker-list broker:9092 --topic topic1 --producer.config compression/client-none.properties --property "parse.key=true" --property "key.separator=:"
560+
0:none
561+
----
555562
556563
[source,bash]
557564
----
@@ -582,6 +589,11 @@ Run a kafka consumer on _topic1_ topic and see the records:
582589
[source,bash]
583590
----
584591
kafka-console-consumer --topic topic1 --bootstrap-server localhost:9092 --from-beginning
592+
none
593+
gzip
594+
snappy
595+
lz4
596+
zstd
585597
----
586598
587599
Teardown:

compression/client-gzip.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
compression.type=gzip
1+
compression.type=gzip
2+
linger.ms=0

compression/client-lz4.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
compression.type=lz4
1+
compression.type=lz4
2+
linger.ms=0

compression/client-none.properties

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
compression.type=none
2+
linger.ms=0

compression/client-snappy.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
compression.type=snappy
1+
compression.type=snappy
2+
linger.ms=0

compression/client-zstd.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
compression.type=zstd
1+
compression.type=zstd
2+
linger.ms=0

0 commit comments

Comments
 (0)