Update STOMP disconnection
This commit is contained in:
@@ -22,7 +22,7 @@ func dial(user, pass string) *stomp.Conn {
|
||||
)
|
||||
if err != nil {
|
||||
log.Fatal("Unable to connect to STOMP Client: " + err.Error())
|
||||
conn.MustDisconnect()
|
||||
conn.Disconnect()
|
||||
}
|
||||
|
||||
log.Info("Initialised STOMP Client")
|
||||
@@ -42,6 +42,11 @@ func Disconnect(conn *stomp.Conn) {
|
||||
return
|
||||
}
|
||||
log.Error("STOMP Disconnect failed, next connection attempt may fail")
|
||||
}
|
||||
err := Client.Disconnect()
|
||||
if err != nil {
|
||||
Client.MustDisconnect()
|
||||
log.Warn("STOMP Disconnect failed, forced disconnection")
|
||||
}
|
||||
log.Info("STOMP Client disconnected")
|
||||
|
||||
// Register against the MQ Server and log each message for testing purposes
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user