Skip to content

Commit 720cfb2

Browse files
committed
exchange: add exchange info callback implementation
Provides to the User access to cache information (size and number of entries). Signed-off-by: Matteo Cafasso <[email protected]>
1 parent b2a5166 commit 720cfb2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/rabbit_message_deduplication_exchange.ex

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,15 @@ defmodule RabbitMQ.MessageDeduplicationExchangeType do
154154
RabbitExchange.assert_args_equivalence(exchange, args)
155155
end
156156

157-
def info(_x) do
158-
[]
157+
def info(exchange) do
158+
info(exchange, [:cache_info])
159+
end
160+
161+
def info(exchange(name: name), [:cache_info]) do
162+
[cache_info: name |> cache_name() |> RabbitMQ.Cache.info()]
159163
end
160164

161-
def info(_x, _y) do
165+
def info(_ex, _it) do
162166
[]
163167
end
164168

0 commit comments

Comments
 (0)