Skip to content

Commit 1ce0a4f

Browse files
authored
Merge pull request #100 from nsweeting/update-deps
Update to amqp 4
2 parents 0a179ae + e28ad30 commit 1ce0a4f

12 files changed

+85
-53
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,39 @@ on:
1010

1111
jobs:
1212
test:
13-
runs-on: ubuntu-20.04
14-
name: Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }}
13+
name: Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }} / RabbitMQ ${{ matrix.rabbitmq }}
14+
runs-on: ubuntu-latest
1515
strategy:
16+
fail-fast: false
1617
matrix:
17-
otp: ['23', '24']
18-
elixir: ['1.11', '1.12', '1.13', '1.14']
18+
include:
19+
# rabbit_common currently does not compile against OTP v27.
20+
# This needs to be fixed upstream to achieve compatibility.
21+
- otp: 27.x
22+
elixir: 1.17.x
23+
rabbitmq: 4
24+
- otp: 27.x
25+
elixir: 1.17.x
26+
rabbitmq: 3
27+
- otp: 26.x
28+
elixir: 1.17.x
29+
rabbitmq: 3
30+
- otp: 26.x
31+
elixir: 1.16.x
32+
rabbitmq: 3
33+
- otp: 26.x
34+
elixir: 1.15.x
35+
rabbitmq: 3
36+
- otp: 26.x
37+
elixir: 1.14.5
38+
rabbitmq: 3
39+
1940
steps:
2041
- name: Checkout
2142
uses: actions/checkout@v3
2243

2344
- name: Start RabbitMQ
24-
run: docker-compose up -d
45+
run: docker compose -f docker-compose.rabbitmq${{matrix.rabbitmq}}.yml up -d
2546

2647
- name: Set up Elixir
2748
uses: erlef/setup-beam@v1

docker-compose.rabbitmq3.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
rabbitmq:
3+
image: "rabbitmq:3-alpine"
4+
ports:
5+
- "5672:5672"

docker-compose.rabbitmq4.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
rabbitmq:
3+
image: "rabbitmq:4-alpine"
4+
ports:
5+
- "5672:5672"

docker-compose.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

mix.exs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
defmodule Rabbit.MixProject do
22
use Mix.Project
33

4-
@version "0.20.0"
4+
@version "0.21.0"
55

66
def project do
77
[
88
app: :rabbit,
99
version: @version,
10-
elixir: "~> 1.7",
10+
elixir: "~> 1.14",
1111
start_permanent: Mix.env() == :prod,
1212
deps: deps(),
1313
description: description(),
@@ -72,14 +72,13 @@ defmodule Rabbit.MixProject do
7272
# Run "mix help deps" to learn about dependencies.
7373
defp deps do
7474
[
75-
{:amqp, "~> 3.0"},
75+
{:amqp, "~> 4.0"},
7676
{:poolboy, "~> 1.5"},
7777
{:keyword_validator, "~> 2.0"},
78-
{:jason, "~> 1.2", optional: true},
78+
{:jason, "~> 1.4", optional: true},
7979
{:benchee, "~> 1.0", only: :dev, runtime: false},
8080
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
81-
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
82-
{:inch_ex, github: "rrrene/inch_ex", only: [:dev, :test], runtime: false},
81+
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
8382
{:ex_doc, "~> 0.28", only: :dev, runtime: false}
8483
]
8584
end

mix.lock

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
%{
2-
"amqp": {:hex, :amqp, "3.3.0", "056d9f4bac96c3ab5a904b321e70e78b91ba594766a1fc2f32afd9c016d9f43b", [:mix], [{:amqp_client, "~> 3.9", [hex: :amqp_client, repo: "hexpm", optional: false]}], "hexpm", "8d3ae139d2646c630d674a1b8d68c7f85134f9e8b2a1c3dd5621616994b10a8b"},
3-
"amqp_client": {:hex, :amqp_client, "3.12.10", "dcc0d5d0037fa2b486c6eb8b52695503765b96f919e38ca864a7b300b829742d", [:make, :rebar3], [{:credentials_obfuscation, "3.4.0", [hex: :credentials_obfuscation, repo: "hexpm", optional: false]}, {:rabbit_common, "3.12.10", [hex: :rabbit_common, repo: "hexpm", optional: false]}], "hexpm", "16a23959899a82d9c2534ed1dcf1fa281d3b660fb7f78426b880647f0a53731f"},
2+
"amqp": {:hex, :amqp, "4.0.0", "c62c0eba8ad5f5bbebf668ca4a68bbf8d9e35c9b3bc8703ff679c01f3e6899d3", [:mix], [{:amqp_client, "~> 4.0", [hex: :amqp_client, repo: "hexpm", optional: false]}], "hexpm", "4148c54dc35733e6c2f9208ff26bc61601cde2da993f752a3452442b018d5735"},
3+
"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"},
44
"benchee": {:hex, :benchee, "1.2.0", "afd2f0caec06ce3a70d9c91c514c0b58114636db9d83c2dc6bfd416656618353", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "ee729e53217898b8fd30aaad3cce61973dab61574ae6f48229fe7ff42d5e4457"},
55
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
66
"credentials_obfuscation": {:hex, :credentials_obfuscation, "3.4.0", "34e18b126b3aefd6e8143776fbe1ceceea6792307c99ac5ee8687911f048cfd7", [:rebar3], [], "hexpm", "738ace0ed5545d2710d3f7383906fc6f6b582d019036e5269c4dbd85dbced566"},
7-
"credo": {:hex, :credo, "1.7.1", "6e26bbcc9e22eefbff7e43188e69924e78818e2fe6282487d0703652bc20fd62", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e9871c6095a4c0381c89b6aa98bc6260a8ba6addccf7f6a53da8849c748a58a2"},
7+
"credo": {:hex, :credo, "1.7.10", "6e64fe59be8da5e30a1b96273b247b5cf1cc9e336b5fd66302a64b25749ad44d", [: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", "71fbc9a6b8be21d993deca85bf151df023a3097b01e09a2809d460348561d8cd"},
88
"deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"},
9-
"dialyxir": {:hex, :dialyxir, "1.4.2", "764a6e8e7a354f0ba95d58418178d486065ead1f69ad89782817c296d0d746a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "516603d8067b2fd585319e4b13d3674ad4f314a5902ba8130cd97dc902ce6bbd"},
9+
"dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"},
1010
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
11-
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
11+
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
1212
"ex_doc": {:hex, :ex_doc, "0.30.9", "d691453495c47434c0f2052b08dd91cc32bc4e1a218f86884563448ee2502dd2", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "d7aaaf21e95dc5cddabf89063327e96867d00013963eadf2c6ad135506a8bc10"},
13-
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
13+
"file_system": {:hex, :file_system, "1.0.1", "79e8ceaddb0416f8b8cd02a0127bdbababe7bf4a23d2a395b983c1f8b3f73edd", [:mix], [], "hexpm", "4414d1f38863ddf9120720cd976fce5bdde8e91d8283353f0e31850fa89feb9e"},
1414
"goldrush": {:hex, :goldrush, "0.1.9", "f06e5d5f1277da5c413e84d5a2924174182fb108dabb39d5ec548b27424cd106", [:rebar3], [], "hexpm", "99cb4128cffcb3227581e5d4d803d5413fa643f4eb96523f77d9e6937d994ceb"},
15-
"inch_ex": {:git, "https://github.com/rrrene/inch_ex.git", "d37c3cd41ceda869696499569547d6f9a416751c", []},
16-
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
15+
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
1716
"jsx": {:hex, :jsx, "3.1.0", "d12516baa0bb23a59bb35dccaf02a1bd08243fcbb9efe24f2d9d056ccff71268", [:rebar3], [], "hexpm", "0c5cc8fdc11b53cc25cf65ac6705ad39e54ecc56d1c22e4adb8f5a53fb9427f3"},
1817
"keyword_validator": {:hex, :keyword_validator, "2.0.1", "92ab90dc93ea9e049530eb0a79c8f074833942dfb93d25e6a946b71b70086b49", [:mix], [], "hexpm", "09715a32d458c6318d39c0a484e958ce20fff64d646188b5801c334179be9fc2"},
1918
"lager": {:hex, :lager, "3.8.2", "b180b814fd8b7082b6ca8aaf287e55a908d304cfc7a240d32f4db2d07092b7d0", [:rebar3], [{:goldrush, "0.1.9", [hex: :goldrush, repo: "hexpm", optional: false]}], "hexpm", "73329ce700410b423f64aafc5f94583073904899098e4461f3558ed2980462ab"},
@@ -22,9 +21,9 @@
2221
"makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"},
2322
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
2423
"poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"},
25-
"rabbit_common": {:hex, :rabbit_common, "3.12.10", "7fc633ee206ae48783d8a5302dfc8fe1e086a5d7de494785ed206f586ad64b34", [: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", "908a8b1bd059f5baefe225fe9d3e2545d35a28db8f6a14d60372556ca7afe641"},
26-
"ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"},
27-
"recon": {:hex, :recon, "2.5.3", "739107b9050ea683c30e96de050bc59248fd27ec147696f79a8797ff9fa17153", [:mix, :rebar3], [], "hexpm", "6c6683f46fd4a1dfd98404b9f78dcabc7fcd8826613a89dcb984727a8c3099d7"},
24+
"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"},
25+
"ranch": {:hex, :ranch, "2.1.0", "2261f9ed9574dcfcc444106b9f6da155e6e540b2f82ba3d42b339b93673b72a3", [:make, :rebar3], [], "hexpm", "244ee3fa2a6175270d8e1fc59024fd9dbc76294a321057de8f803b1479e76916"},
26+
"recon": {:hex, :recon, "2.5.6", "9052588e83bfedfd9b72e1034532aee2a5369d9d9343b61aeb7fbce761010741", [:mix, :rebar3], [], "hexpm", "96c6799792d735cc0f0fd0f86267e9d351e63339cbe03df9d162010cefc26bb0"},
2827
"statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"},
29-
"thoas": {:hex, :thoas, "1.0.0", "567c03902920827a18a89f05b79a37b5bf93553154b883e0131801600cf02ce0", [:rebar3], [], "hexpm", "fc763185b932ecb32a554fb735ee03c3b6b1b31366077a2427d2a97f3bd26735"},
28+
"thoas": {:hex, :thoas, "1.2.1", "19a25f31177a17e74004d4840f66d791d4298c5738790fa2cc73731eb911f195", [:rebar3], [], "hexpm", "e38697edffd6e91bd12cea41b155115282630075c2a727e7a6b2947f5408b86a"},
3029
}

test/connection_test.exs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ defmodule Rabbit.ConnectionTest do
33

44
alias Rabbit.Connection
55

6+
@moduletag :capture_log
7+
68
defmodule TestConnection do
79
use Rabbit.Connection
810

11+
def start_link(opts) do
12+
Rabbit.Connection.start_link(__MODULE__, opts)
13+
end
14+
915
@impl Rabbit.Connection
1016
def init(_type, opts) do
1117
{:ok, opts}
@@ -39,11 +45,11 @@ defmodule Rabbit.ConnectionTest do
3945
end
4046

4147
test "returns error when given bad connection options" do
42-
assert {:error, _} = Connection.start_link(TestConnection, uri: 1)
48+
assert {:error, _} = start_supervised({TestConnection, uri: 1})
4349
end
4450

4551
test "returns error when given bad pool options" do
46-
assert {:error, _} = Connection.start_link(TestConnection, pool_size: "foo")
52+
assert {:error, _} = start_supervised({TestConnection, pool_size: "foo"})
4753
end
4854
end
4955

test/consumer_supervisor_test.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ defmodule Rabbit.ConsumerSupervisorTest do
33

44
alias Rabbit.{Connection, ConsumerSupervisor}
55

6+
@moduletag :capture_log
7+
68
defmodule TestConnection do
79
use Rabbit.Connection
810

test/consumer_test.exs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ defmodule Rabbit.ConsumerTest do
33

44
alias Rabbit.{Connection, Consumer, Producer}
55

6+
@moduletag :capture_log
7+
68
defmodule TestConnection do
79
use Rabbit.Connection
810

@@ -24,6 +26,10 @@ defmodule Rabbit.ConsumerTest do
2426
defmodule TestConsumer do
2527
use Rabbit.Consumer
2628

29+
def start_link(opts) do
30+
Rabbit.Consumer.start_link(__MODULE__, opts)
31+
end
32+
2733
@impl Rabbit.Consumer
2834
def init(:consumer, opts) do
2935
if is_pid(Process.whereis(:consumer_test)), do: send(:consumer_test, :init_callback)
@@ -144,7 +150,7 @@ defmodule Rabbit.ConsumerTest do
144150
end
145151

146152
test "returns error when given bad consumer options" do
147-
assert {:error, _} = Consumer.start_link(TestConsumer, connection: 1)
153+
assert {:error, _} = start_supervised({TestConsumer, connection: 1})
148154
end
149155
end
150156

test/producer_test.exs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ defmodule Rabbit.ProducerTest do
33

44
alias Rabbit.{Connection, Producer}
55

6+
@moduletag :capture_log
7+
68
defmodule TestConnection do
79
use Rabbit.Connection
810

@@ -15,6 +17,10 @@ defmodule Rabbit.ProducerTest do
1517
defmodule TestProducer do
1618
use Rabbit.Producer
1719

20+
def start_link(opts) do
21+
Rabbit.Producer.start_link(__MODULE__, opts)
22+
end
23+
1824
@impl Rabbit.Producer
1925
def init(_type, opts) do
2026
{:ok, opts}
@@ -42,7 +48,7 @@ defmodule Rabbit.ProducerTest do
4248
end
4349

4450
test "returns error when given bad producer options" do
45-
{:error, _} = Producer.start_link(TestProducer, connection: "foo")
51+
{:error, _} = start_supervised({TestProducer, connection: "foo"})
4652
end
4753

4854
test "returns error when given bad pool options" do

0 commit comments

Comments
 (0)