Skip to content

Commit 5121213

Browse files
committed
Update README
Signed-off-by: Matteo Cafasso <[email protected]>
1 parent 7784274 commit 5121213

File tree

1 file changed

+38
-21
lines changed

1 file changed

+38
-21
lines changed

README.md

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
RabbitMQ Message Deduplication Plugin
2-
=====================================
1+
# RabbitMQ Message Deduplication Plugin
32

43
A plugin for filtering duplicate messages.
54

6-
Exchange Type: `x-message-deduplication`
5+
Messages can be deduplicated when published into an exchange or enqueued to a queue.
76

8-
Installing
9-
----------
7+
## Installing
108

119
Supported RabbitMQ versions:
1210

@@ -20,8 +18,7 @@ Enable the plugin:
2018
[sudo] rabbitmq-plugins enable rabbitmq_message_deduplication_exchange
2119
```
2220

23-
Building from Source
24-
--------------------
21+
## Building from Source
2522

2623
Please see RabbitMQ Plugin Development guide.
2724

@@ -39,35 +36,55 @@ Then copy all the *.ez files inside the plugins folder to the [RabbitMQ plugins
3936
[sudo] rabbitmq-plugins enable rabbitmq_message_deduplication_exchange
4037
```
4138

42-
Declare an exchange
43-
-------------------
39+
## Exchange level deduplication
40+
41+
The exchange type `x-message-deduplication` allows to filter message duplicates before any routing rule is applied.
42+
43+
Each message containing the `x-deduplication-header` header will not be routed if its value has been submitted previously. The amount of time a given message will be guaranteed to be unique can be controlled via the `x-cache-ttl` exchange argument or message header.
44+
45+
### Declare an exchange
4446

4547
To create a message deduplication exchange, just declare it providing the type `x-message-deduplication`.
4648

4749
Extra arguments:
4850

49-
* `x-cache-size`: maximum size for the deduplication cache.
51+
* `x-cache-size`: maximum size for the deduplication cache. If the deduplication cache fills up, older entries will be removed to give space to new ones.
5052
This parameter is mandatory.
51-
* `x-cache-ttl`: amount of time in milliseconds messages are kept in cache.
53+
* `x-cache-ttl`: amount of time in milliseconds duplicate headers are kept in cache.
5254
This parameter is optional.
53-
* `x-cache-persistence`: whether the cache will persist on disk or in memory.
54-
This parameter is optional. Default persistence is memory.
55+
* `x-cache-persistence`: whether the duplicates cache will persist on disk or in memory.
56+
This parameter is optional. Default persistence type is `memory`.
57+
58+
### Message headers
59+
60+
* `x-deduplication-header`: messages will be deduplicated based on the content of this header. If the header is not provided, the message will not be checked against duplicates.
61+
* `x-cache-ttl`: this header is optional and will override the default value provided during the exchange declaration. This header controls for how many milliseconds to deduplicate the message. After the TTL expires, a new message with the same header will be routed again.
62+
63+
## Queue level deduplication
64+
65+
A queue declared with the `x-message-deduplication` parameter enabled will filter message duplicates before they are published within.
66+
67+
Each message containing the `x-deduplication-header` header will not be enqueued if another message with the same header is already present within the queue.
68+
69+
### Declare a queue
70+
71+
When declaring a queue, it is possible to enable message deduplication via the `x-message-deduplication` boolean argument.
72+
73+
Extra arguments:
5574

56-
Message deduplication
57-
---------------------
75+
* `x-cache-persistence`: whether the duplicates cache will persist on disk or in memory.
76+
This parameter is optional. Default persistence type is `memory`.
5877

59-
Each message containing the `x-deduplication-header` header will not be routed if its value has been already submitted previously and has not expired.
78+
### Message headers
6079

61-
The optional header `x-cache-ttl` will override the default one if provided during the exchange declaration. This parameter controls for how many milliseconds to deduplicate the message. After the TTL expires, a new message with the same `x-deduplication-header` header will be routed again.
80+
* `x-deduplication-header`: messages will be deduplicated based on the content of this header. If the header is not provided, the message will not be checked against duplicates.
6281

63-
Running the tests
64-
-----------------
82+
## Running the tests
6583

6684
```bash
6785
make tests
6886
```
6987

70-
License
71-
-------
88+
## License
7289

7390
See the LICENSE file.

0 commit comments

Comments
 (0)