From 2a1888d65097a624cf4f2ab6b60b8810a3319e53 Mon Sep 17 00:00:00 2001 From: Luka Tchumburidze Date: Fri, 2 Feb 2024 11:34:06 +0400 Subject: [PATCH 1/2] changed rabbitmq lib dependency from streadway/amqp v1.0.0 to rabbitmq/amqp091-go v1.9.0 --- go.mod | 2 +- go.sum | 13 +++++++++++-- pkg/queue/rabbitmq/internal/confirmation.go | 2 +- pkg/queue/rabbitmq/internal/connection/consumer.go | 2 +- .../rabbitmq/internal/connection/consumer_test.go | 2 +- pkg/queue/rabbitmq/internal/connection/publisher.go | 2 +- pkg/queue/rabbitmq/internal/event/subscriber.go | 2 +- pkg/queue/rabbitmq/internal/message/subscriber.go | 2 +- pkg/queue/rabbitmq/internal/subscribers.go | 2 +- test/modules/rabbitmq/shared.go | 2 +- 10 files changed, 20 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index be09975..d4c5dd1 100644 --- a/go.mod +++ b/go.mod @@ -6,8 +6,8 @@ require ( github.com/IGLOU-EU/go-wildcard v1.0.3 github.com/magiconair/properties v1.8.7 github.com/prometheus/client_golang v1.14.0 + github.com/rabbitmq/amqp091-go v1.9.0 github.com/rs/zerolog v1.29.0 - github.com/streadway/amqp v1.0.0 github.com/stretchr/testify v1.8.4 github.com/testcontainers/testcontainers-go v0.23.0 google.golang.org/grpc v1.58.0 diff --git a/go.sum b/go.sum index 4be3cfd..88eb0a6 100644 --- a/go.sum +++ b/go.sum @@ -49,7 +49,10 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -89,22 +92,27 @@ github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/rabbitmq/amqp091-go v1.9.0 h1:qrQtyzB4H8BQgEuJwhmVQqVHB9O4+MNDJCCAcpc3Aoo= +github.com/rabbitmq/amqp091-go v1.9.0/go.mod h1:+jPrT9iY2eLjRaMSRHUhc3z14E/l85kv/f+6luSD3pc= github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= -github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/testcontainers/testcontainers-go v0.23.0 h1:ERYTSikX01QczBLPZpqsETTBO7lInqEP349phDOVJVs= github.com/testcontainers/testcontainers-go v0.23.0/go.mod h1:3gzuZfb7T9qfcH2pHpV4RLlWrPjeWNQah6XlYQ32c4I= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -159,6 +167,7 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/queue/rabbitmq/internal/confirmation.go b/pkg/queue/rabbitmq/internal/confirmation.go index c6e57c4..05a89d5 100644 --- a/pkg/queue/rabbitmq/internal/confirmation.go +++ b/pkg/queue/rabbitmq/internal/confirmation.go @@ -17,8 +17,8 @@ package internal import ( "github.com/prometheus/client_golang/prometheus" + amqp "github.com/rabbitmq/amqp091-go" "github.com/rs/zerolog" - "github.com/streadway/amqp" ) type DeliveryConfirmation struct { diff --git a/pkg/queue/rabbitmq/internal/connection/consumer.go b/pkg/queue/rabbitmq/internal/connection/consumer.go index 22158a8..5064bb2 100644 --- a/pkg/queue/rabbitmq/internal/connection/consumer.go +++ b/pkg/queue/rabbitmq/internal/connection/consumer.go @@ -19,8 +19,8 @@ import ( "errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" + amqp "github.com/rabbitmq/amqp091-go" "github.com/rs/zerolog" - "github.com/streadway/amqp" "github.com/th2-net/th2-common-go/pkg/metrics" ) diff --git a/pkg/queue/rabbitmq/internal/connection/consumer_test.go b/pkg/queue/rabbitmq/internal/connection/consumer_test.go index 729cb9d..9a27db4 100644 --- a/pkg/queue/rabbitmq/internal/connection/consumer_test.go +++ b/pkg/queue/rabbitmq/internal/connection/consumer_test.go @@ -16,8 +16,8 @@ package connection import ( + amqp "github.com/rabbitmq/amqp091-go" "github.com/rs/zerolog" - "github.com/streadway/amqp" "github.com/stretchr/testify/assert" "github.com/th2-net/th2-common-go/test/modules/rabbitmq" "os" diff --git a/pkg/queue/rabbitmq/internal/connection/publisher.go b/pkg/queue/rabbitmq/internal/connection/publisher.go index 3d6c85f..ee32a4e 100644 --- a/pkg/queue/rabbitmq/internal/connection/publisher.go +++ b/pkg/queue/rabbitmq/internal/connection/publisher.go @@ -21,8 +21,8 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" + amqp "github.com/rabbitmq/amqp091-go" "github.com/rs/zerolog" - "github.com/streadway/amqp" "github.com/th2-net/th2-common-go/pkg/metrics" ) diff --git a/pkg/queue/rabbitmq/internal/event/subscriber.go b/pkg/queue/rabbitmq/internal/event/subscriber.go index 28ee672..997e6a9 100644 --- a/pkg/queue/rabbitmq/internal/event/subscriber.go +++ b/pkg/queue/rabbitmq/internal/event/subscriber.go @@ -27,7 +27,7 @@ import ( "github.com/th2-net/th2-common-go/pkg/queue/rabbitmq/internal" "github.com/th2-net/th2-common-go/pkg/queue/rabbitmq/internal/connection" - "github.com/streadway/amqp" + amqp "github.com/rabbitmq/amqp091-go" "github.com/th2-net/th2-common-go/pkg/metrics" "github.com/th2-net/th2-common-go/pkg/queue/event" "google.golang.org/protobuf/proto" diff --git a/pkg/queue/rabbitmq/internal/message/subscriber.go b/pkg/queue/rabbitmq/internal/message/subscriber.go index be57e16..2bbee39 100644 --- a/pkg/queue/rabbitmq/internal/message/subscriber.go +++ b/pkg/queue/rabbitmq/internal/message/subscriber.go @@ -28,7 +28,7 @@ import ( "github.com/th2-net/th2-common-go/pkg/queue/rabbitmq/internal" "github.com/th2-net/th2-common-go/pkg/queue/rabbitmq/internal/connection" - "github.com/streadway/amqp" + amqp "github.com/rabbitmq/amqp091-go" "github.com/th2-net/th2-common-go/pkg/metrics" "github.com/th2-net/th2-common-go/pkg/queue/message" "google.golang.org/protobuf/proto" diff --git a/pkg/queue/rabbitmq/internal/subscribers.go b/pkg/queue/rabbitmq/internal/subscribers.go index 70579aa..eb2819b 100644 --- a/pkg/queue/rabbitmq/internal/subscribers.go +++ b/pkg/queue/rabbitmq/internal/subscribers.go @@ -19,8 +19,8 @@ import ( "errors" "fmt" "github.com/prometheus/client_golang/prometheus" + amqp "github.com/rabbitmq/amqp091-go" "github.com/rs/zerolog" - "github.com/streadway/amqp" "github.com/th2-net/th2-common-go/pkg/queue" "github.com/th2-net/th2-common-go/pkg/queue/rabbitmq/internal/connection" "io" diff --git a/test/modules/rabbitmq/shared.go b/test/modules/rabbitmq/shared.go index 7db2bb4..038cb0b 100644 --- a/test/modules/rabbitmq/shared.go +++ b/test/modules/rabbitmq/shared.go @@ -18,7 +18,7 @@ package rabbitmq import ( "context" "fmt" - "github.com/streadway/amqp" + amqp "github.com/rabbitmq/amqp091-go" "github.com/stretchr/testify/assert" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" From b46cdbd73a0f88072bb8a6ffa3739e0503ac40e9 Mon Sep 17 00:00:00 2001 From: Oleg Date: Sun, 3 Mar 2024 12:17:27 +0400 Subject: [PATCH 2/2] Update readme --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d3beb0c..42e4de1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# th2 common library GO (1.0.0) +# th2 common library GO (1.2.0) ## Usage @@ -90,6 +90,13 @@ The `CommonFactory` reads a message's router configuration from the `mq.json` fi ## Release notes +### 1.2.0 + +#### Dependencies + ++ Deprecated `streadway/amqp` dependency was replaced with `rabbitmq/amqp091-go`. + NOTE: this should not be visible to end users as the MQ is only used internally. + ### 1.0.0 #### Implemented: