This is an automated email from the ASF dual-hosted git repository.
penghui pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
The following commit(s) were added to refs/heads/main by this push:
new e882afc52289 Explain retain policy messages without keys for
compaction (#769)
e882afc52289 is described below
commit e882afc522899c6f3723e6485e541d6a2566d779
Author: Cong Zhao <[email protected]>
AuthorDate: Wed Jan 24 19:35:29 2024 +0800
Explain retain policy messages without keys for compaction (#769)
---
docs/cookbooks-compaction.md | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/docs/cookbooks-compaction.md b/docs/cookbooks-compaction.md
index 73e464d8b685..8de0929a08ed 100644
--- a/docs/cookbooks-compaction.md
+++ b/docs/cookbooks-compaction.md
@@ -13,8 +13,14 @@ To use compaction:
* Compaction can be configured to run
[automatically](#configure-compaction-to-run-automatically), or you can
manually [trigger](#trigger-compaction-manually) compaction using the Pulsar
administrative API.
* Your consumers must be [configured](#configure-consumers) to read from
compacted topics (Java consumers, for example, have a `readCompacted` setting
that must be set to `true`). If this configuration is not set, consumers will
still be able to read from the non-compacted topic.
+:::tip
+
+Compaction only works on messages that have keys (as in the stock ticker
example the stock symbol serves as the key for each message). Keys can thus be
thought of as the axis along which compaction is applied. Messages that don't
have keys are simply ignored by compaction.
-> Compaction only works on messages that have keys (as in the stock ticker
example the stock symbol serves as the key for each message). Keys can thus be
thought of as the axis along which compaction is applied. Messages that don't
have keys are simply ignored by compaction.
+PIP-318 introduced the `topicCompactionRetainNullKey` configuration on broker
side, which allows you to configure whether to retain messages without keys
during compaction. And since 3.2.0+ version, the default don't retain null-key
message during topic compaction.
+For more information, see
[PIP-318](https://github.com/apache/pulsar/blob/master/pip/pip-318.md).
+
+:::
## When should I use compacted topics?