Skip to content

Commit fd9cf72

Browse files
authored
Update rabbit libraries to 4.0 (#216)
1 parent b4a9acc commit fd9cf72

14 files changed

+36
-23
lines changed

.github/workflows/cd.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ jobs:
1111
- name: Setup Elixir
1212
uses: erlef/setup-beam@v1
1313
with:
14-
otp-version: "25"
15-
elixir-version: "1.14"
14+
otp-version: "26"
15+
elixir-version: "1.16"
1616
- name: Checkout
1717
uses: actions/checkout@v3
1818
- name: setup hex

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
steps:
1717
- uses: erlef/setup-beam@v1
1818
with:
19-
elixir-version: 1.14
20-
otp-version: 25
19+
elixir-version: 1.16
20+
otp-version: 26
2121

2222
# Check out the code.
2323
- name: Checkout

.github/workflows/retire.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
- uses: actions/checkout@v4
3535
- uses: erlef/setup-beam@v1
3636
with:
37-
otp-version: "25"
38-
elixir-version: "1.14"
37+
otp-version: "26"
38+
elixir-version: "1.16"
3939
- run: echo "Attempting to retire version $VERSION"
4040
- run: mix hex.config api_key "$HEX_AUTH_KEY"
4141
env:

.tool-versions

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
erlang 25.3.2.8
2-
elixir 1.14.5-otp-25
1+
erlang 26.2.5.3
2+
elixir 1.16.3-otp-26

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ and this project adheres to
88

99
## [Unreleased]
1010

11+
### Updated
12+
13+
- rabbit libraries to `amqp_client` and `rabbit_common` to 4.0
14+
15+
- Increased minimum supported elixir version to 1.16, otp 26
16+
17+
This is due to elixir rabbit not supporting the older versions of the libraries
18+
1119
---
1220

1321
## [6.1.2] - 2024-12-02

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM public.ecr.aws/prima/elixir:1.14.2-5
1+
FROM public.ecr.aws/prima/elixir:1.16.3
22

33
WORKDIR /code
44

lib/amqp/gen/connection_manager.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ defmodule Amqpx.Gen.ConnectionManager do
5656
end
5757

5858
def handle_info(message, state) do
59-
Logger.warn("Unknown message received #{inspect(message)}")
59+
Logger.warning("Unknown message received #{inspect(message)}")
6060
{:noreply, state}
6161
end
6262

lib/amqp/gen/consumer.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ defmodule Amqpx.Gen.Consumer do
182182
def handle_info({:EXIT, _, :normal}, state), do: {:noreply, state}
183183

184184
def handle_info(message, state) do
185-
Logger.warn("Unknown message received #{inspect(message)}")
185+
Logger.warning("Unknown message received #{inspect(message)}")
186186
{:noreply, state}
187187
end
188188

lib/amqp/gen/producer.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ defmodule Amqpx.Gen.Producer do
3131

3232
# Public API
3333

34-
@spec start_link(opts :: map()) :: GenServer.server()
34+
@spec start_link(opts :: map()) :: GenServer.on_start()
3535
def start_link(opts) do
3636
gen_server_opts =
3737
opts
@@ -129,7 +129,7 @@ defmodule Amqpx.Gen.Producer do
129129
def handle_info({:EXIT, _, :normal}, state), do: {:noreply, state}
130130

131131
def handle_info(message, state) do
132-
Logger.warn("Unknown message received #{inspect(message)}")
132+
Logger.warning("Unknown message received #{inspect(message)}")
133133
{:noreply, state}
134134
end
135135

lib/amqp/helper.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ defmodule Amqpx.Helper do
9898
"If x-dead-letter-exchange is an empty string, x-dead-letter-routing-key should be '#{dlq}' instead of '#{bad_dlq}'"
9999

100100
if Enum.member?(skip_dead_letter_routing_key_check_for(), bad_dlq) do
101-
Logger.warn(msg)
101+
Logger.warning(msg)
102102
else
103103
raise msg
104104
end

mix.exs

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule Amqpx.MixProject do
66
app: :amqpx,
77
name: "amqpx",
88
version: "6.1.2",
9-
elixir: "~> 1.14",
9+
elixir: "~> 1.16",
1010
elixirc_paths: elixirc_paths(Mix.env()),
1111
start_permanent: Mix.env() == :production,
1212
deps: deps(),
@@ -51,8 +51,8 @@ defmodule Amqpx.MixProject do
5151
# Run "mix help deps" to learn about dependencies.
5252
defp deps do
5353
[
54-
{:amqp_client, "~> 3.9"},
55-
{:rabbit_common, "~> 3.9"},
54+
{:amqp_client, "~> 4.0"},
55+
{:rabbit_common, "~> 4.0"},
5656
{:elixir_uuid, "~> 1.2"},
5757
{:credo, "~> 1.5", only: [:dev, :test, :gha]},
5858
{:mock, "~> 0.3.7", only: [:test, :gha]},

mix.lock

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
%{
2-
"amqp_client": {:hex, :amqp_client, "3.12.14", "2b677bc3f2e2234ba7517042b25d72071a79735042e91f9116bd3c176854b622", [:make, :rebar3], [{:credentials_obfuscation, "3.4.0", [hex: :credentials_obfuscation, repo: "hexpm", optional: false]}, {:rabbit_common, "3.12.14", [hex: :rabbit_common, repo: "hexpm", optional: false]}], "hexpm", "5f70b6c3b1a739790080da4fddc94a867e99f033c4b1edc20d6ff8b8fb4bd160"},
2+
"amqp_client": {:hex, :amqp_client, "4.0.3", "c7dcc8031c780cd39ec586ba827a8eb26e006e9761af8d3f58fded11f645ebd4", [:make, :rebar3], [{:credentials_obfuscation, "3.4.0", [hex: :credentials_obfuscation, repo: "hexpm", optional: false]}, {:rabbit_common, "4.0.3", [hex: :rabbit_common, repo: "hexpm", optional: false]}], "hexpm", "ae945f7280617e9a4b17a6d49e3a2f496d716e8088ec29d8e94ecc79e5da7458"},
33
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
44
"credentials_obfuscation": {:hex, :credentials_obfuscation, "3.4.0", "34e18b126b3aefd6e8143776fbe1ceceea6792307c99ac5ee8687911f048cfd7", [:rebar3], [], "hexpm", "738ace0ed5545d2710d3f7383906fc6f6b582d019036e5269c4dbd85dbced566"},
55
"credo": {:hex, :credo, "1.7.11", "d3e805f7ddf6c9c854fd36f089649d7cf6ba74c42bc3795d587814e3c9847102", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "56826b4306843253a66e47ae45e98e7d284ee1f95d53d1612bb483f88a8cf219"},
@@ -16,7 +16,8 @@
1616
"meck": {:hex, :meck, "0.9.2", "85ccbab053f1db86c7ca240e9fc718170ee5bda03810a6292b5306bf31bae5f5", [:rebar3], [], "hexpm", "81344f561357dc40a8344afa53767c32669153355b626ea9fcbc8da6b3045826"},
1717
"mock": {:hex, :mock, "0.3.9", "10e44ad1f5962480c5c9b9fa779c6c63de9bd31997c8e04a853ec990a9d841af", [:mix], [{:meck, "~> 0.9.2", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm", "9e1b244c4ca2551bb17bb8415eed89e40ee1308e0fbaed0a4fdfe3ec8a4adbd3"},
1818
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
19-
"rabbit_common": {:hex, :rabbit_common, "3.12.14", "466123ee7346a3cdac078c0c302bcd36da4523e8acd678c1b992f7b4df1f7914", [:make, :rebar3], [{:credentials_obfuscation, "3.4.0", [hex: :credentials_obfuscation, repo: "hexpm", optional: false]}, {:recon, "2.5.3", [hex: :recon, repo: "hexpm", optional: false]}, {:thoas, "1.0.0", [hex: :thoas, repo: "hexpm", optional: false]}], "hexpm", "70c31a51f7401cc0204ddef2745d98680c2e0df67e3b0c9e198916881fde3293"},
20-
"recon": {:hex, :recon, "2.5.3", "739107b9050ea683c30e96de050bc59248fd27ec147696f79a8797ff9fa17153", [:mix, :rebar3], [], "hexpm", "6c6683f46fd4a1dfd98404b9f78dcabc7fcd8826613a89dcb984727a8c3099d7"},
21-
"thoas": {:hex, :thoas, "1.0.0", "567c03902920827a18a89f05b79a37b5bf93553154b883e0131801600cf02ce0", [:rebar3], [], "hexpm", "fc763185b932ecb32a554fb735ee03c3b6b1b31366077a2427d2a97f3bd26735"},
19+
"rabbit_common": {:hex, :rabbit_common, "4.0.3", "e927b882733d122f6802662220bdb1a83774852dbe67d21d4e33aaf54f3998dd", [:make, :rebar3], [{:credentials_obfuscation, "3.4.0", [hex: :credentials_obfuscation, repo: "hexpm", optional: false]}, {:ranch, "2.1.0", [hex: :ranch, repo: "hexpm", optional: false]}, {:recon, "2.5.6", [hex: :recon, repo: "hexpm", optional: false]}, {:thoas, "1.2.1", [hex: :thoas, repo: "hexpm", optional: false]}], "hexpm", "ead31ba292c2cc5fda48a486417d7cfe8966f661994d7ed6c3e5f8840828e8ec"},
20+
"ranch": {:hex, :ranch, "2.1.0", "2261f9ed9574dcfcc444106b9f6da155e6e540b2f82ba3d42b339b93673b72a3", [:make, :rebar3], [], "hexpm", "244ee3fa2a6175270d8e1fc59024fd9dbc76294a321057de8f803b1479e76916"},
21+
"recon": {:hex, :recon, "2.5.6", "9052588e83bfedfd9b72e1034532aee2a5369d9d9343b61aeb7fbce761010741", [:mix, :rebar3], [], "hexpm", "96c6799792d735cc0f0fd0f86267e9d351e63339cbe03df9d162010cefc26bb0"},
22+
"thoas": {:hex, :thoas, "1.2.1", "19a25f31177a17e74004d4840f66d791d4298c5738790fa2cc73731eb911f195", [:rebar3], [], "hexpm", "e38697edffd6e91bd12cea41b155115282630075c2a727e7a6b2947f5408b86a"},
2223
}

test/connection_test.exs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ defmodule ConnectionTest do
88

99
@obfuscate_password false
1010

11-
@invalid_ip '192.168.1.1'
12-
@valid_ip '192.168.1.2'
11+
@invalid_ip ~c"192.168.1.1"
12+
@valid_ip ~c"192.168.1.2"
1313

1414
@open_options [
1515
username: "amqpx",

test/gen_test.exs

+4
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,8 @@ defmodule Amqpx.Test.AmqpxTest do
451451

452452
describe "configuration validation" do
453453
test "if retry_policy is configured, max_retries must be > 0" do
454+
Process.flag(:trap_exit, true)
455+
454456
assert {:error, {:invalid_configuration, "when retry policy is configured, max_retries must be > 0"}} =
455457
Amqpx.Gen.Producer.start_link(%{
456458
name: :producer_misconfigured_retry_policy_max_retries,
@@ -471,6 +473,8 @@ defmodule Amqpx.Test.AmqpxTest do
471473
end
472474

473475
test "if retry_policy is configured, max_retries must be set" do
476+
Process.flag(:trap_exit, true)
477+
474478
assert {:error, {:invalid_configuration, "when retry policy is configured, max_retries must be > 0"}} =
475479
Amqpx.Gen.Producer.start_link(%{
476480
name: :producer_misconfigured_retry_policy_max_retries,

0 commit comments

Comments
 (0)