Skip to content

Commit e4c3135

Browse files
committed
On initializing RabbitMQ connection close old connection if available.
1 parent 11ad4a4 commit e4c3135

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

isc/rabbitmq/Common.cls

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ Method ConnectToRabbitMQ() As %Status
9090
}
9191

9292
Try {
93+
If $IsObject(..API) {
94+
Do ..API.close()
95+
Set ..API = $$$NULLOREF
96+
}
97+
9398
Set ..API = ##class(isc.rabbitmq.API).%New(..JGW, ..Host, ..Port, user, pass, ..VirtualHost, ..Queue, $$$YES, ..Exchange)
9499
} Catch ex {
95100
Set sc = ..ExceptionToStatus(ex)

0 commit comments

Comments
 (0)