activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [21/23] activemq-artemis git commit: Fixing tests (clustering)
Date Wed, 01 Mar 2017 17:21:15 GMT
Fixing tests (clustering)


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

Branch: refs/heads/artemis-1009
Commit: 5fbf7ab98f213455fb1d0e12a325ae27b2f9a8eb
Parents: 326a8e4
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Wed Mar 1 09:52:51 2017 -0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Mar 1 12:19:03 2017 -0500

----------------------------------------------------------------------
 .../activemq/artemis/api/core/Message.java      | 20 ++++++++++++++++++--
 .../core/client/impl/ClientConsumerImpl.java    |  2 +-
 .../core/client/impl/ClientMessageImpl.java     |  5 -----
 .../core/client/impl/ClientMessageInternal.java |  7 -------
 .../core/client/impl/ClientProducerImpl.java    | 19 ++++++++++---------
 .../core/server/impl/ActiveMQServerImpl.java    |  3 +--
 6 files changed, 30 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5fbf7ab9/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 b266279..a6ef408 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
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.artemis.api.core;
 
+import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
@@ -174,14 +175,29 @@ public interface Message {
 
    void messageChanged();
 
+
+   /** Used for Large messages on Core.
+    *  Do not use this, it will go away
+    *  @deprecated  use it directly from core message, as it doesn't make sense on other
protocols */
+   @Deprecated
+   default InputStream getBodyInputStream() {
+      return null;
+   }
+
    /**
     * Careful: Unless you are changing the body of the message, prefer getReadOnlyBodyBuffer
-    */
+    *  @deprecated  use it directly from core message, as it doesn't make sense on other
protocols */
+   @Deprecated
    ActiveMQBuffer getBodyBuffer();
 
+   /**
+    *  @deprecated  use it directly from core message, as it doesn't make sense on other
protocols */
+   @Deprecated
    ActiveMQBuffer getReadOnlyBodyBuffer();
 
-   /** Used in the cases of large messages */
+   /** Used in the cases of large messages
+    *  @deprecated  use it directly from core message, as it doesn't make sense on other
protocols */
+   @Deprecated
    LargeBodyEncoder getBodyEncoder() throws ActiveMQException;
 
    /** Context can be used by the application server to inject extra control, like a protocol
specific on the server.

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5fbf7ab9/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
index 2b4ab7e..d95aeba 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientConsumerImpl.java
@@ -569,7 +569,7 @@ public final class ClientConsumerImpl implements ClientConsumerInternal
{
 
    private void handleRegularMessage(ClientMessageInternal message) {
       if (message.getAddress() == null) {
-         message.setAddressTransient(queueInfo.getAddress());
+         message.setAddress(queueInfo.getAddress());
       }
 
       message.onReceipt(this);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5fbf7ab9/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageImpl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageImpl.java
index 9472b01..252ae86 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageImpl.java
@@ -102,11 +102,6 @@ public class ClientMessageImpl extends CoreMessage implements ClientMessageInter
    }
 
    @Override
-   public void setAddressTransient(SimpleString address) {
-      this.address = address;
-   }
-
-   @Override
    public TypedProperties getProperties() {
       return this.checkProperties();
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5fbf7ab9/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageInternal.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageInternal.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageInternal.java
index 878f799..4b87878 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageInternal.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientMessageInternal.java
@@ -16,9 +16,6 @@
  */
 package org.apache.activemq.artemis.core.client.impl;
 
-import java.io.InputStream;
-
-import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.client.ClientMessage;
 import org.apache.activemq.artemis.utils.TypedProperties;
 
@@ -36,8 +33,6 @@ public interface ClientMessageInternal extends ClientMessage {
     */
    void setFlowControlSize(int flowControlSize);
 
-   void setAddressTransient(SimpleString address);
-
    void onReceipt(ClientConsumerInternal consumer);
 
    /**
@@ -47,6 +42,4 @@ public interface ClientMessageInternal extends ClientMessage {
 
    boolean isCompressed();
 
-   InputStream getBodyInputStream();
-
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5fbf7ab9/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java
index ce16011..1704de0 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientProducerImpl.java
@@ -208,7 +208,7 @@ public class ClientProducerImpl implements ClientProducerInternal {
    }
 
    private void doSend(SimpleString sendingAddress,
-                       final Message msg,
+                       final Message msgToSend,
                        final SendAcknowledgementHandler handler,
                        final boolean forceAsync) throws ActiveMQException {
       if (sendingAddress == null) {
@@ -217,7 +217,8 @@ public class ClientProducerImpl implements ClientProducerInternal {
       session.startCall();
 
       try {
-         Message msgI = msg;
+         // In case we received message from another protocol, we first need to convert it
to core as the ClientProducer only understands core
+         Message msg = msgToSend.toCore();
 
          ClientProducerCredits theCredits;
 
@@ -225,8 +226,8 @@ public class ClientProducerImpl implements ClientProducerInternal {
          // a note about the second check on the writerIndexSize,
          // If it's a server's message, it means this is being done through the bridge or
some special consumer on the
          // server's on which case we can't' convert the message into large at the servers
-         if (sessionContext.supportsLargeMessage() && (getBodyInputStream(msgI) !=
null || msgI.isLargeMessage() ||
-            msgI.getBodyBuffer().writerIndex() > minLargeMessageSize)) {
+         if (sessionContext.supportsLargeMessage() && (getBodyInputStream(msg) !=
null || msg.isLargeMessage() ||
+            msg.getBodyBuffer().writerIndex() > minLargeMessageSize)) {
             isLarge = true;
          } else {
             isLarge = false;
@@ -248,19 +249,19 @@ public class ClientProducerImpl implements ClientProducerInternal {
          }
 
          if (groupID != null) {
-            msgI.putStringProperty(Message.HDR_GROUP_ID, groupID);
+            msg.putStringProperty(Message.HDR_GROUP_ID, groupID);
          }
 
-         final boolean sendBlockingConfig = msgI.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;
+         final boolean sendBlockingConfig = msg.isDurable() ? blockOnDurableSend : blockOnNonDurableSend;
          final boolean forceAsyncOverride = handler != null;
          final boolean sendBlocking = sendBlockingConfig && !forceAsyncOverride;
 
          session.workDone();
 
          if (isLarge) {
-            largeMessageSend(sendBlocking, (CoreMessage)msgI, theCredits, handler);
+            largeMessageSend(sendBlocking, (CoreMessage)msg, theCredits, handler);
          } else {
-            sendRegularMessage(sendingAddress, msgI, sendBlocking, theCredits, handler);
+            sendRegularMessage(sendingAddress, msg, sendBlocking, theCredits, handler);
          }
       } finally {
          session.endCall();
@@ -268,7 +269,7 @@ public class ClientProducerImpl implements ClientProducerInternal {
    }
 
    private InputStream getBodyInputStream(Message msgI) {
-      return ((ClientMessageInternal)msgI).getBodyInputStream();
+      return msgI.getBodyInputStream();
    }
 
    private void sendRegularMessage(final SimpleString sendingAddress,

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/5fbf7ab9/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 38500b7..2b5ecaf 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -51,6 +51,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.ActiveMQDeleteAddressException;
 import org.apache.activemq.artemis.api.core.Pair;
+import org.apache.activemq.artemis.api.core.RoutingType;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl;
 import org.apache.activemq.artemis.core.config.BridgeConfiguration;
@@ -127,7 +128,6 @@ import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.QueueConfig;
 import org.apache.activemq.artemis.core.server.QueueFactory;
 import org.apache.activemq.artemis.core.server.QueueQueryResult;
-import org.apache.activemq.artemis.api.core.RoutingType;
 import org.apache.activemq.artemis.core.server.SecuritySettingPlugin;
 import org.apache.activemq.artemis.core.server.ServerSession;
 import org.apache.activemq.artemis.core.server.ServiceComponent;
@@ -2622,7 +2622,6 @@ public class ActiveMQServerImpl implements ActiveMQServer {
    @Override
    public void addProtocolManagerFactory(ProtocolManagerFactory factory) {
       protocolManagerFactories.add(factory);
-      new Exception("protocol....").printStackTrace();
    }
 
    @Override


Mime
View raw message