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
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
44
46
45
47
To create a message deduplication exchange, just declare it providing the type `x-message-deduplication`.
46
48
47
49
Extra arguments:
48
50
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.
50
52
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.
52
54
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:
55
74
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`.
58
77
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
60
79
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.
0 commit comments