You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<4> Scroll to the content for the next publishing ID
624
632
<5> Set the message publishing
625
633
634
+
[[sub-entry-batching-and-compression]]
635
+
===== Sub-Entry Batching and Compression
636
+
637
+
RabbitMQ Stream provides a special mode to publish, store, and dispatch messages: sub-entry batching.
638
+
This mode increases throughput at the cost of increased latency and potential duplicated messages even when deduplication is enabled.
639
+
It also allows using compression to reduce bandwidth and storage if messages are reasonably similar, at the cost of increasing CPU usage on the client side.
640
+
641
+
Sub-entry batching consists in squeezing several messages – a batch – in the slot that is usually used for one message.
642
+
This means outbound messages are not only batched in publishing frames, but in sub-entries as well.
643
+
644
+
You can enable sub-entry batching by setting the `ProducerBuilder#subEntrySize` parameter to a value greater than 1, like in the following snippet:
You are encouraged to test and evaluate the compression algorithms depending on your needs.
697
+
698
+
The compression libraries are pluggable thanks to the `EnvironmentBuilder#compressionCodecFactory(CompressionCodecFactory)` method.
699
+
700
+
701
+
[NOTE]
702
+
.Consumers, sub-entry batching, and compression
703
+
====
704
+
There is no configuration required for consumers with regard to sub-entry batching and compression.
705
+
The broker dispatches messages to client libraries: they are supposed to figure out the format of messages, extract them from their sub-entry, and decompress them if necessary.
706
+
So when you set up sub-entry batching and compression in your publishers, the consuming applications must use client libraries that support this mode, which is the case for the stream Java client.
707
+
====
708
+
626
709
==== Consumer
627
710
628
711
`Consumer` is the API to consume messages from a stream.
0 commit comments