Skip to content

Commit

Permalink
On initializing RabbitMQ connection close old connection if available.
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard93 committed Mar 14, 2020
1 parent 11ad4a4 commit e4c3135
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions isc/rabbitmq/Common.cls
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ Method ConnectToRabbitMQ() As %Status
}

Try {
If $IsObject(..API) {
Do ..API.close()
Set ..API = $$$NULLOREF
}

Set ..API = ##class(isc.rabbitmq.API).%New(..JGW, ..Host, ..Port, user, pass, ..VirtualHost, ..Queue, $$$YES, ..Exchange)
} Catch ex {
Set sc = ..ExceptionToStatus(ex)
Expand Down

0 comments on commit e4c3135

Please sign in to comment.