You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by an...@apache.org on 2017/03/21 17:22:19 UTC
[1/2] activemq-artemis git commit: This closes #1112 ARTEMIS-1053 use
creds for active server check
Repository: activemq-artemis
Updated Branches:
refs/heads/master 1282daf68 -> 93342905a
This closes #1112 ARTEMIS-1053 use creds for active server check
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/93342905
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/93342905
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/93342905
Branch: refs/heads/master
Commit: 93342905a88f750309af89329e4c714e76533a68
Parents: 1282daf a9360f5
Author: Andy Taylor <an...@gmail.com>
Authored: Tue Mar 21 17:21:56 2017 +0000
Committer: Andy Taylor <an...@gmail.com>
Committed: Tue Mar 21 17:21:56 2017 +0000
----------------------------------------------------------------------
.../server/impl/SharedNothingLiveActivation.java | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
[2/2] activemq-artemis git commit: ARTEMIS-1053 use creds for active
server check
Posted by an...@apache.org.
ARTEMIS-1053 use creds for active server check
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/a9360f55
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/a9360f55
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/a9360f55
Branch: refs/heads/master
Commit: a9360f559955c24feb61beefa15f454085a0f7d3
Parents: 1282daf
Author: Justin Bertram <jb...@apache.org>
Authored: Tue Mar 21 10:20:18 2017 -0500
Committer: Andy Taylor <an...@gmail.com>
Committed: Tue Mar 21 17:21:56 2017 +0000
----------------------------------------------------------------------
.../server/impl/SharedNothingLiveActivation.java | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a9360f55/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java
index b36326c..7e8eb5d 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingLiveActivation.java
@@ -317,7 +317,7 @@ public class SharedNothingLiveActivation extends LiveActivation {
ClusterConnectionConfiguration config = ConfigurationUtils.getReplicationClusterConfiguration(activeMQServer.getConfiguration(), replicatedPolicy.getClusterName());
- NodeIdListener listener = new NodeIdListener(nodeId0);
+ NodeIdListener listener = new NodeIdListener(nodeId0, activeMQServer.getConfiguration().getClusterUser(), activeMQServer.getConfiguration().getClusterPassword());
try (ServerLocatorInternal locator = getLocator(config)) {
locator.addClusterTopologyListener(listener);
@@ -396,10 +396,14 @@ public class SharedNothingLiveActivation extends LiveActivation {
volatile boolean isNodePresent = false;
private final SimpleString nodeId;
+ private final String user;
+ private final String password;
private final CountDownLatch latch = new CountDownLatch(1);
- NodeIdListener(SimpleString nodeId) {
+ NodeIdListener(SimpleString nodeId, String user, String password) {
this.nodeId = nodeId;
+ this.user = user;
+ this.password = password;
}
@Override
@@ -427,11 +431,13 @@ public class SharedNothingLiveActivation extends LiveActivation {
boolean result = false;
try (ServerLocator serverLocator = ActiveMQClient.createServerLocator(false, transportConfiguration);
- ClientSessionFactory clientSessionFactory = serverLocator.createSessionFactory();
- ClientSession clientSession = clientSessionFactory.createSession();) {
+ ClientSessionFactory clientSessionFactory = serverLocator.createSessionFactory();
+ ClientSession clientSession = clientSessionFactory.createSession(user, password, false, false, false, false, 0)) {
result = true;
} catch (Exception e) {
- // ignore
+ if (logger.isDebugEnabled()) {
+ logger.debug("isActive check failed", e);
+ }
}
return result;