diff --git a/ees/amqp.go b/ees/amqp.go index 9ac594bfe..ea35bcff5 100644 --- a/ees/amqp.go +++ b/ees/amqp.go @@ -145,7 +145,8 @@ func (pstr *AMQPee) ExportEvent(_ *context.Context, content, _ any) (err error) pstr.reqs.done() return utils.ErrDisconnected } - err = pstr.postChan.Publish( + err = pstr.postChan.PublishWithContext( + context.TODO(), pstr.exchange, // exchange pstr.routingKey, // routing key false, // mandatory diff --git a/ers/amqp_it_test.go b/ers/amqp_it_test.go index 282547eff..3ba4c0ba3 100644 --- a/ers/amqp_it_test.go +++ b/ers/amqp_it_test.go @@ -27,6 +27,7 @@ import ( "testing" "time" + "github.com/cgrates/birpc/context" "github.com/cgrates/cgrates/config" "github.com/cgrates/cgrates/engine" "github.com/cgrates/cgrates/utils" @@ -91,7 +92,8 @@ func TestAMQPER(t *testing.T) { rdr.Serve() randomOriginID := utils.UUIDSha1Prefix() - if err = channel.Publish( + if err = channel.PublishWithContext( + context.Background(), "test-exchange", // publish to an exchange "test-key", // routing to 0 or more queues false, // mandatory