Skip to content

Commit

Permalink
Merge pull request grafana#23 from grafana/paul/client-update
Browse files Browse the repository at this point in the history
Change client to rabbitmq/amqp091-go
  • Loading branch information
javaducky authored Jan 11, 2023
2 parents 69fcb9e + de03d53 commit fad34a9
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 452 deletions.
8 changes: 5 additions & 3 deletions amqp.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
package amqp

import (
"context"
"encoding/json"

amqpDriver "github.com/streadway/amqp"
amqpDriver "github.com/rabbitmq/amqp091-go"
"github.com/vmihailenco/msgpack/v5"
"go.k6.io/k6/js/modules"
)

const version = "v0.1.0"
const version = "v0.3.0"

// AMQP type holds connection to a remote AMQP server.
type AMQP struct {
Expand Down Expand Up @@ -106,7 +107,8 @@ func (amqp *AMQP) Publish(options PublishOptions) error {
publishing.DeliveryMode = amqpDriver.Persistent
}

return ch.Publish(
return ch.PublishWithContext(
context.Background(), // TODO: use vu context
options.Exchange,
options.QueueName,
options.Mandatory,
Expand Down
2 changes: 1 addition & 1 deletion exchanges.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package amqp

import (
amqpDriver "github.com/streadway/amqp"
amqpDriver "github.com/rabbitmq/amqp091-go"
)

// Exchange defines a connection to publish/subscribe destinations.
Expand Down
29 changes: 26 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
module github.com/grafana/xk6-amqp

go 1.15
go 1.17

require (
github.com/streadway/amqp v1.0.0
github.com/rabbitmq/amqp091-go v1.5.0
github.com/vmihailenco/msgpack/v5 v5.3.5
go.k6.io/k6 v0.33.0
go.k6.io/k6 v0.42.0
)

require (
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/dop251/goja v0.0.0-20221106173738-3b8a68ca89b4 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/go-sourcemap/sourcemap v2.1.4-0.20211119122758-180fcef48034+incompatible // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mstoykov/atlas v0.0.0-20220808085829-90340e9998bd // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.24.2 // indirect
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect
github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.1.2 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect
gopkg.in/guregu/null.v3 v3.3.0 // indirect
)
Loading

0 comments on commit fad34a9

Please sign in to comment.