Quantcast

[1/3] activemq-artemis git commit: ARTEMIS-1101 Fixing JMSFilter on AMQP

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[1/3] activemq-artemis git commit: ARTEMIS-1101 Fixing JMSFilter on AMQP

clebertsuconic-2
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 305d16fd3 -> d531c5aac


ARTEMIS-1101 Fixing JMSFilter on AMQP


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/cc22a028
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/cc22a028
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/cc22a028

Branch: refs/heads/master
Commit: cc22a0286bce7aadca47adc21e6286977402a2e6
Parents: 305d16f
Author: Clebert Suconic <[hidden email]>
Authored: Tue Apr 11 09:58:31 2017 -0400
Committer: Clebert Suconic <[hidden email]>
Committed: Tue Apr 11 16:07:33 2017 -0400

----------------------------------------------------------------------
 .../apache/activemq/artemis/api/core/Message.java  |  7 +++++--
 .../artemis/protocol/amqp/broker/AMQPMessage.java  | 17 +++++++++++++++++
 .../protocol/amqp/message/AMQPMessageTest.java     |  2 +-
 .../artemis/core/filter/impl/FilterImpl.java       |  7 ++-----
 .../artemis/core/server/ActiveMQServerLogger.java  |  2 +-
 5 files changed, 26 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cc22a028/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
index e9c4fec..bef2f81 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
@@ -305,8 +305,11 @@ public interface Message {
 
 
    /**
-    * Returns the userID - this is an optional user specified UUID that can be set to identify the message
-    * and will be passed around with the message
+    *
+    * This represents historically the JMSMessageID.
+    * We had in the past used this for the MessageID that was sent on core messages...
+    *
+    * later on when we added AMQP this name clashed with AMQPMessage.getUserID();
     *
     * @return the user id
     */

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cc22a028/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
index d076b21..d627fd5 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
@@ -511,6 +511,22 @@ public class AMQPMessage extends RefCountMessage {
    @Override
    public Object getUserID() {
       Properties properties = getProperties();
+      if (properties != null && properties.getMessageId() != null) {
+         return properties.getMessageId();
+      } else {
+         return null;
+      }
+   }
+
+   /**
+    * Before we added AMQP into Artemis / Hornetq, the name getUserID was already taken by JMSMessageID.
+    * We cannot simply change the names now as it would break the API for existing clients.
+    *
+    * This is to return and read the proper AMQP userID.
+    * @return
+    */
+   public Object getAMQPUserID() {
+      Properties properties = getProperties();
       if (properties != null && properties.getUserId() != null) {
          Binary binary = properties.getUserId();
          return new String(binary.getArray(), binary.getArrayOffset(), binary.getLength(), StandardCharsets.UTF_8);
@@ -519,6 +535,7 @@ public class AMQPMessage extends RefCountMessage {
       }
    }
 
+
    @Override
    public org.apache.activemq.artemis.api.core.Message setUserID(Object userID) {
       return null;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cc22a028/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/message/AMQPMessageTest.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/message/AMQPMessageTest.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/message/AMQPMessageTest.java
index 496454b..8b379a3 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/message/AMQPMessageTest.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/protocol/amqp/message/AMQPMessageTest.java
@@ -147,7 +147,7 @@ public class AMQPMessageTest {
 
       AMQPMessage decoded = encodeAndDecodeMessage(protonMessage);
 
-      assertEquals(USER_NAME, decoded.getUserID());
+      assertEquals(USER_NAME, decoded.getAMQPUserID());
    }
 
    @Test

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cc22a028/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java
index 33a1187..23ca545 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/filter/impl/FilterImpl.java
@@ -79,10 +79,7 @@ public class FilterImpl implements Filter {
       try {
          booleanExpression = SelectorParser.parse(filterStr.toString());
       } catch (Throwable e) {
-         ActiveMQServerLogger.LOGGER.invalidFilter(filterStr);
-         if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) {
-            ActiveMQServerLogger.LOGGER.debug("Invalid filter", e);
-         }
+         ActiveMQServerLogger.LOGGER.invalidFilter(filterStr, e);
          throw ActiveMQMessageBundle.BUNDLE.invalidFilter(e, filterStr);
       }
       return new FilterImpl(filterStr, booleanExpression);
@@ -108,7 +105,7 @@ public class FilterImpl implements Filter {
          boolean result = booleanExpression.matches(new FilterableServerMessage(message));
          return result;
       } catch (Exception e) {
-         ActiveMQServerLogger.LOGGER.invalidFilter(sfilterString);
+         ActiveMQServerLogger.LOGGER.invalidFilter(sfilterString, e);
          if (ActiveMQServerLogger.LOGGER.isDebugEnabled()) {
             ActiveMQServerLogger.LOGGER.debug("Invalid filter", e);
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cc22a028/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
index df576b2..9aaba7c 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java
@@ -1320,7 +1320,7 @@ public interface ActiveMQServerLogger extends BasicLogger {
 
    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 224006, value = "Invalid filter: {0}", format = Message.Format.MESSAGE_FORMAT)
-   void invalidFilter(SimpleString filter);
+   void invalidFilter(SimpleString filter, @Cause Throwable cause);
 
    @LogMessage(level = Logger.Level.ERROR)
    @Message(id = 224007, value = "page subscription = {0} error={1}", format = Message.Format.MESSAGE_FORMAT)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[3/3] activemq-artemis git commit: This closes #1199

clebertsuconic-2
This closes #1199


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/d531c5aa
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/d531c5aa
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/d531c5aa

Branch: refs/heads/master
Commit: d531c5aac51b92a6f401d30d47763f739c5577ed
Parents: 305d16f 5d407a8
Author: Clebert Suconic <[hidden email]>
Authored: Tue Apr 11 19:10:23 2017 -0400
Committer: Clebert Suconic <[hidden email]>
Committed: Tue Apr 11 19:10:23 2017 -0400

----------------------------------------------------------------------
 .../apache/activemq/artemis/api/core/Message.java  |  7 +++++--
 .../artemis/protocol/amqp/broker/AMQPMessage.java  | 17 +++++++++++++++++
 .../protocol/amqp/message/AMQPMessageTest.java     |  2 +-
 .../artemis/core/filter/impl/FilterImpl.java       |  7 ++-----
 .../artemis/core/server/ActiveMQServerLogger.java  |  2 +-
 .../artemis/tests/integration/amqp/ProtonTest.java |  2 ++
 6 files changed, 28 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[2/3] activemq-artemis git commit: NO-JIRA: Fixing ProtonTest::testAddressControlSendMessage

clebertsuconic-2
In reply to this post by clebertsuconic-2
NO-JIRA: Fixing ProtonTest::testAddressControlSendMessage


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/5d407a88
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/5d407a88
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/5d407a88

Branch: refs/heads/master
Commit: 5d407a88b3d23a802f5891ab512f1d34e7c3da90
Parents: cc22a02
Author: Clebert Suconic <[hidden email]>
Authored: Tue Apr 11 19:07:11 2017 -0400
Committer: Clebert Suconic <[hidden email]>
Committed: Tue Apr 11 19:08:02 2017 -0400

----------------------------------------------------------------------
 .../apache/activemq/artemis/tests/integration/amqp/ProtonTest.java | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5d407a88/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
index 938e7ae..c2201e7 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/ProtonTest.java
@@ -264,6 +264,8 @@ public class ProtonTest extends ProtonTestBase {
       Assert.assertEquals(1, addressControl.getQueueNames().length);
       addressControl.sendMessage(null, org.apache.activemq.artemis.api.core.Message.BYTES_TYPE, Base64.encodeBytes("test".getBytes()), false, userName, password);
 
+      Wait.waitFor(() -> addressControl.getMessageCount() == 1);
+
       Assert.assertEquals(1, addressControl.getMessageCount());
 
       Connection connection = createConnection("myClientId");

Loading...