Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ jobs:
- { RMQREF: "v4.1.x", ERLVER: "27", ELXVER: "1.18" }
- { RMQREF: "v4.2.x", ERLVER: "27", ELXVER: "1.18" }
- { RMQREF: "v4.3.x", ERLVER: "27", ELXVER: "1.18" }
- { RMQREF: "main", ERLVER: "27", ELXVER: "1.18" }
- { RMQREF: "v4.4.x", ERLVER: "29", ELXVER: "1.20" }
- { RMQREF: "main", ERLVER: "29", ELXVER: "1.20" }
name: "Broker: ${{ matrix.PLATFORM.RMQREF }} - Erlang: ${{ matrix.PLATFORM.ERLVER }} - Elixir: ${{ matrix.PLATFORM.ELXVER }}"
steps:
- name: Checkout RabbitMQ Server
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PROJECT = rabbitmq_message_deduplication

RABBITMQ_VERSION ?= v4.3.x
RABBITMQ_VERSION ?= v4.4.x
current_rmq_ref = $(RABBITMQ_VERSION)

# The Application needs to depend on `rabbit` in order to be detected as a plugin.
Expand Down
1 change: 0 additions & 1 deletion lib/rabbitmq_message_deduplication/cache_manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ defmodule RabbitMQMessageDeduplication.CacheManager do
use GenServer

require Logger
require RabbitMQMessageDeduplication.Cache

alias :os, as: OS
alias :erpc, as: ERPC
Expand Down
2 changes: 0 additions & 2 deletions lib/rabbitmq_message_deduplication/common.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ defmodule RabbitMQMessageDeduplication.Common do

"""

require RabbitMQMessageDeduplication.Cache

alias :mc, as: MC
alias :rabbit_nodes, as: RabbitNodes
alias :rabbit_feature_flags, as: RabbitFeatureFlags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ defmodule RabbitMQMessageDeduplication.Exchange do
import Record, only: [defrecord: 2, extract: 2]

require Logger
require RabbitMQMessageDeduplication.Cache
require RabbitMQMessageDeduplication.Common

alias :rabbit_misc, as: RabbitMisc
alias :rabbit_policy, as: RabbitPolicy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ defmodule RabbitMQMessageDeduplication.Queue do
import Record, only: [defrecord: 2]

require Logger
require RabbitMQMessageDeduplication.Cache
require RabbitMQMessageDeduplication.Common

alias :mc, as: MC
alias :amqqueue, as: AMQQueue
Expand Down
4 changes: 3 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ defmodule RabbitMQ.MessageDeduplicationPlugin.MixProject do
cache_wait_time: Timer.seconds(30),
cache_maintenance_period: Timer.seconds(3)
],
# Since RabbitMQ 4.4 these are semver ranges and `X.Y.Z` only matches
# that exact version. Older brokers accept any `X.Y.*` >= `X.Y.Z`.
broker_version_requirements: if Mix.env == :prod do
["3.13.0", "4.0.0", "4.1.0", "4.2.0", "4.3.0"]
["3.13.0", "4.0.0", "4.1.0", "4.2.0", "4.3.0", "4.4.x"]
else
[]
end
Expand Down
14 changes: 14 additions & 0 deletions test/cache_manager_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ defmodule RabbitMQMessageDeduplication.CacheManager.Test do
start_supervised!(%{id: :cache_manager,
start: {CacheManager, :start_link, [true]}})

# The Cache Manager stops Mnesia asynchronously on termination.
# Since Erlang/OTP 29, starting Mnesia while it is stopping returns
# without waiting for the stop, so the next test would find it stopped.
on_exit(&await_mnesia_stopped/0)

%{}
end

Expand Down Expand Up @@ -70,5 +75,14 @@ defmodule RabbitMQMessageDeduplication.CacheManager.Test do
end

def caches(), do: :message_deduplication_caches

defp await_mnesia_stopped() do
case Mnesia.system_info(:is_running) do
:no -> :ok
_ ->
Timer.sleep(10)
await_mnesia_stopped()
end
end
def cluster_nodes_stub(), do: []
end
Loading