Skip to content

Commit

Permalink
Close AMQP publisher session explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuratczyk committed Nov 28, 2024
1 parent 15a3ce4 commit 20dbdef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/amqp10_client/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ func (p *Amqp10Publisher) Send() error {

func (p *Amqp10Publisher) Stop(reason string) {
log.Debug("closing connection", "id", p.Id, "reason", reason)
if p.Session != nil {
_ = p.Session.Close(context.Background())
}
if p.Connection != nil {
_ = p.Connection.Close()
}
Expand Down

0 comments on commit 20dbdef

Please sign in to comment.