Skip to content

Commit 06d2c07

Browse files
golang: bump github.com/rabbitmq/amqp091-go from 1.3.4 to 1.4.0 (#208)
* golang: bump github.com/rabbitmq/amqp091-go from 1.3.4 to 1.4.0 Bumps [github.com/rabbitmq/amqp091-go](https://github.com/rabbitmq/amqp091-go) from 1.3.4 to 1.4.0. - [Release notes](https://github.com/rabbitmq/amqp091-go/releases) - [Commits](rabbitmq/amqp091-go@v1.3.4...v1.4.0) --- updated-dependencies: - dependency-name: github.com/rabbitmq/amqp091-go dependency-type: direct:production update-type: version-update:semver-minor ...
1 parent 007181c commit 06d2c07

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ require (
2929
github.com/ory/dockertest/v3 v3.9.1
3030
github.com/pkg/errors v0.9.1
3131
github.com/prometheus/client_golang v1.13.0
32-
github.com/rabbitmq/amqp091-go v1.3.4
32+
github.com/rabbitmq/amqp091-go v1.4.0
3333
github.com/scim2/filter-parser/v2 v2.2.0
3434
github.com/spf13/cobra v1.5.0
3535
go.uber.org/automaxprocs v1.5.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -953,8 +953,8 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1
953953
github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo=
954954
github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4=
955955
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
956-
github.com/rabbitmq/amqp091-go v1.3.4 h1:tXuIslN1nhDqs2t6Jrz3BAoqvt4qIZzxvdbdcxWtHYU=
957-
github.com/rabbitmq/amqp091-go v1.3.4/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM=
956+
github.com/rabbitmq/amqp091-go v1.4.0 h1:T2G+J9W9OY4p64Di23J6yH7tOkMocgnESvYeBjuG9cY=
957+
github.com/rabbitmq/amqp091-go v1.4.0/go.mod h1:JsV0ofX5f1nwOGafb8L5rBItt9GyhfQfcJj+oyz0dGg=
958958
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ=
959959
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
960960
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=

pkg/eventsourcing/messaging/bus_rabbitmq.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ func (b *rabbitEventBus) PublishEvent(ctx context.Context, event evs.Event) erro
108108
}
109109

110110
err = b.publisher.Publish(
111+
ctx,
111112
rabbitMessageBytes,
112113
[]string{b.generateRoutingKey(event)},
113114
rabbitmq.WithPublishOptionsContentType("application/json"),

pkg/rabbitmq/consume_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
package rabbitmq
1616

1717
import (
18+
"context"
19+
1820
. "github.com/onsi/ginkgo"
1921
. "github.com/onsi/gomega"
2022
amqp "github.com/rabbitmq/amqp091-go"
@@ -50,7 +52,7 @@ var _ = Describe("Pkg/Rabbitmq/Consume", func() {
5052
Expect(err).ToNot(HaveOccurred())
5153
defer consumer.StopConsuming(expectedConsumerName, false)
5254

53-
err = publisher.Publish([]byte("test"), []string{expectedRoutingKey}, WithPublishOptionsExchange(expectedExchangeName))
55+
err = publisher.Publish(context.Background(), []byte("test"), []string{expectedRoutingKey}, WithPublishOptionsExchange(expectedExchangeName))
5456
Expect(err).ToNot(HaveOccurred())
5557

5658
Eventually(done, 60).Should(BeClosed())

pkg/rabbitmq/publish.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package rabbitmq
1616

1717
import (
18+
"context"
1819
"fmt"
1920
"sync"
2021

@@ -150,6 +151,7 @@ func NewPublisher(url string, config *amqp.Config) (*Publisher, <-chan amqp.Retu
150151

151152
// Publish publishes the provided data to the given routing keys over the connection
152153
func (publisher *Publisher) Publish(
154+
ctx context.Context,
153155
data []byte,
154156
routingKeys []string,
155157
optionFuncs ...func(*PublishOptions),
@@ -177,7 +179,7 @@ func (publisher *Publisher) Publish(
177179
message.Expiration = options.Expiration
178180

179181
// Actual publish.
180-
err := publisher.chManager.channel.Publish(
182+
err := publisher.chManager.channel.PublishWithContext(ctx,
181183
options.Exchange,
182184
routingKey,
183185
options.Mandatory,

0 commit comments

Comments
 (0)