CORDA-1536: Fix client infinitely re-trying when incorrect endpoint specified. (#3243)

Apparently, if incorrect endpoint provided, ActiveMQNotConnectedException is thrown
which is different to ActiveMQSecurityException. Extend catch block to: ActiveMQException
to cater for all such cases.
This commit is contained in:
Viktor Kolomeyko 2018-05-29 14:05:51 +01:00 committed by GitHub
parent 6791ea800d
commit 8a5978e881
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ import net.corda.core.transactions.SignedTransaction
import net.corda.core.utilities.NetworkHostAndPort
import net.corda.core.utilities.contextLogger
import net.corda.core.utilities.seconds
import org.apache.activemq.artemis.api.core.ActiveMQSecurityException
import org.apache.activemq.artemis.api.core.ActiveMQException
import rx.Observable
import rx.Subscription
import rx.subjects.PublishSubject
@ -192,8 +192,11 @@ class NodeMonitorModel {
val nodeInfo = _connection.proxy.nodeInfo()
require(nodeInfo.legalIdentitiesAndCerts.isNotEmpty())
_connection
} catch(secEx: ActiveMQSecurityException) {
// Happens when incorrect credentials provided - no point to retry connecting.
} catch(secEx: ActiveMQException) {
// Happens when:
// * incorrect credentials provided;
// * incorrect endpoint specified;
// - no point to retry connecting.
throw secEx
}
catch(th: Throwable) {