You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2017/07/18 20:17:10 UTC
[1/3] activemq-artemis git commit: This closes #1406
Repository: activemq-artemis
Updated Branches:
refs/heads/master ad372ec98 -> 00d880eb0
This closes #1406
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/00d880eb
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/00d880eb
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/00d880eb
Branch: refs/heads/master
Commit: 00d880eb0380750ba4b2a4612293122497b0f703
Parents: ad372ec e742de7
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Jul 18 16:16:42 2017 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Jul 18 16:16:42 2017 -0400
----------------------------------------------------------------------
.../impl/wireformat/QueueAbstractPacket.java | 9 +++++++
.../core/ServerSessionPacketHandler.java | 9 +++++--
.../core/server/impl/ServerSessionImpl.java | 11 +-------
.../tests/integration/client/SessionTest.java | 28 ++------------------
4 files changed, 19 insertions(+), 38 deletions(-)
----------------------------------------------------------------------
[2/3] activemq-artemis git commit: ARTEMIS-1290 QueueQuery add prefix
on address 2
Posted by cl...@apache.org.
ARTEMIS-1290 QueueQuery add prefix on address 2
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/e742de7d
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/e742de7d
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/e742de7d
Branch: refs/heads/master
Commit: e742de7d6e7ecf4af367d21de5285cfe91f7322b
Parents: 34df3af
Author: Martyn Taylor <mt...@redhat.com>
Authored: Tue Jul 18 19:43:23 2017 +0100
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Jul 18 16:16:42 2017 -0400
----------------------------------------------------------------------
.../protocol/core/impl/wireformat/QueueAbstractPacket.java | 9 +++++++++
.../activemq/artemis/core/server/QueueQueryResult.java | 4 ++++
.../core/protocol/core/ServerSessionPacketHandler.java | 9 +++++++--
3 files changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e742de7d/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QueueAbstractPacket.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QueueAbstractPacket.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QueueAbstractPacket.java
index 767cd0c..641d7cc 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QueueAbstractPacket.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/QueueAbstractPacket.java
@@ -21,6 +21,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
@@ -108,4 +109,12 @@ public abstract class QueueAbstractPacket extends PacketImpl {
public QueueAbstractPacket(byte type) {
super(type);
}
+
+ public static SimpleString getOldPrefixedAddress(SimpleString address, RoutingType routingType) {
+ switch (routingType) {
+ case MULTICAST: return OLD_TOPIC_PREFIX.concat(address);
+ case ANYCAST: return OLD_QUEUE_PREFIX.concat(address);
+ default: return address;
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e742de7d/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/QueueQueryResult.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/QueueQueryResult.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/QueueQueryResult.java
index 3fd818d..cf88d62 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/QueueQueryResult.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/QueueQueryResult.java
@@ -138,4 +138,8 @@ public class QueueQueryResult {
public int getMaxConsumers() {
return maxConsumers;
}
+
+ public void setAddress(SimpleString address) {
+ this.address = address;
+ }
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e742de7d/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
index 06fb288..88a6c2c 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/ServerSessionPacketHandler.java
@@ -92,10 +92,10 @@ import org.apache.activemq.artemis.core.server.LargeServerMessage;
import org.apache.activemq.artemis.core.server.QueueQueryResult;
import org.apache.activemq.artemis.core.server.ServerSession;
import org.apache.activemq.artemis.spi.core.remoting.Connection;
-import org.apache.activemq.artemis.utils.actors.Actor;
-import org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory;
import org.apache.activemq.artemis.utils.SimpleFuture;
import org.apache.activemq.artemis.utils.SimpleFutureImpl;
+import org.apache.activemq.artemis.utils.actors.Actor;
+import org.apache.activemq.artemis.utils.actors.OrderedExecutorFactory;
import org.jboss.logging.Logger;
import static org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl.CREATE_ADDRESS;
@@ -387,6 +387,11 @@ public class ServerSessionPacketHandler implements ChannelHandler {
requiresResponse = true;
SessionQueueQueryMessage request = (SessionQueueQueryMessage) packet;
QueueQueryResult result = session.executeQueueQuery(request.getQueueName(remotingConnection.getClientVersion()));
+
+ if (remotingConnection.getClientVersion() < PacketImpl.ADDRESSING_CHANGE_VERSION) {
+ result.setAddress(SessionQueueQueryMessage.getOldPrefixedAddress(result.getAddress(), result.getRoutingType()));
+ }
+
if (channel.supports(PacketImpl.SESS_QUEUEQUERY_RESP_V3)) {
response = new SessionQueueQueryResponseMessage_V3(result);
} else if (channel.supports(PacketImpl.SESS_QUEUEQUERY_RESP_V2)) {
[3/3] activemq-artemis git commit: Revert "ARTEMIS-1290 QueueQuery
add prefix on address"
Posted by cl...@apache.org.
Revert "ARTEMIS-1290 QueueQuery add prefix on address"
This reverts commit 44506f2258271953018a951e11c1c53588995d9f.
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/34df3afe
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/34df3afe
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/34df3afe
Branch: refs/heads/master
Commit: 34df3afe0c3f268b8a0b5acdcefa9606a6dad8fc
Parents: ad372ec
Author: Martyn Taylor <mt...@redhat.com>
Authored: Tue Jul 18 19:43:43 2017 +0100
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Jul 18 16:16:42 2017 -0400
----------------------------------------------------------------------
.../artemis/core/server/QueueQueryResult.java | 4 ---
.../core/server/impl/ServerSessionImpl.java | 11 +-------
.../tests/integration/client/SessionTest.java | 28 ++------------------
3 files changed, 3 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34df3afe/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/QueueQueryResult.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/QueueQueryResult.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/QueueQueryResult.java
index cf88d62..3fd818d 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/QueueQueryResult.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/server/QueueQueryResult.java
@@ -138,8 +138,4 @@ public class QueueQueryResult {
public int getMaxConsumers() {
return maxConsumers;
}
-
- public void setAddress(SimpleString address) {
- this.address = address;
- }
}
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34df3afe/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
index bd8c395..8e557d3 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
@@ -728,16 +728,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
@Override
public QueueQueryResult executeQueueQuery(final SimpleString name) throws Exception {
- QueueQueryResult result = server.queueQuery(removePrefix(name));
- if (prefixEnabled) {
- for (Map.Entry<SimpleString, RoutingType> entry : prefixes.entrySet()) {
- if (entry.getValue() == result.getRoutingType()) {
- result.setAddress(entry.getKey().concat(result.getAddress()));
- break;
- }
- }
- }
- return result;
+ return server.queueQuery(removePrefix(name));
}
@Override
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/34df3afe/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
index de2cc23..9954a4e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/SessionTest.java
@@ -21,9 +21,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.ActiveMQInternalErrorException;
-import org.apache.activemq.artemis.api.core.RoutingType;
import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.core.client.ActiveMQClient;
import org.apache.activemq.artemis.api.core.client.ClientConsumer;
import org.apache.activemq.artemis.api.core.client.ClientMessage;
import org.apache.activemq.artemis.api.core.client.ClientProducer;
@@ -34,7 +32,6 @@ import org.apache.activemq.artemis.api.core.client.ServerLocator;
import org.apache.activemq.artemis.api.core.client.SessionFailureListener;
import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal;
import org.apache.activemq.artemis.core.client.impl.ClientSessionInternal;
-import org.apache.activemq.artemis.core.config.Configuration;
import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
@@ -62,11 +59,8 @@ public class SessionTest extends ActiveMQTestBase {
public void setUp() throws Exception {
super.setUp();
- locator = createNettyNonHALocator();
- Configuration configuration = createDefaultNettyConfig();
- configuration.addAcceptorConfiguration("prefixed", "tcp://localhost:61617?multicastPrefix=multicast://;anycastPrefix=anycast://");
- server = createServer(configuration);
- createServer(false);
+ locator = createInVMNonHALocator();
+ server = createServer(false);
server.start();
waitForServerToStart(server);
}
@@ -212,24 +206,6 @@ public class SessionTest extends ActiveMQTestBase {
clientSession.close();
}
- @Test
- public void testQueueQueryWithAddressPrefix() throws Exception {
- String address = new String("testAddress");
-
- cf = ActiveMQClient.createServerLocator("tcp://localhost:61617").createSessionFactory();
- ClientSession clientSession = cf.createSession(false, true, true);
-
- clientSession.createQueue(address, RoutingType.ANYCAST, queueName + "1", false);
- clientSession.createQueue(address, RoutingType.MULTICAST, queueName + "2", false);
-
- QueueQuery respA = clientSession.queueQuery(new SimpleString(queueName + "1"));
- QueueQuery respM = clientSession.queueQuery(new SimpleString(queueName + "2"));
-
- Assert.assertEquals(new SimpleString("anycast://" + address), respA.getAddress());
- Assert.assertEquals(new SimpleString("multicast://" + address), respM.getAddress());
- clientSession.close();
- }
-
private void flushQueue() throws Exception {
Queue queue = server.locateQueue(SimpleString.toSimpleString(queueName));
assertNotNull(queue);