qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1773126 - in /qpid/java/trunk: broker-core/src/main/java/org/apache/qpid/server/message/ broker-core/src/main/java/org/apache/qpid/server/message/internal/ broker-core/src/test/java/org/apache/qpid/server/message/ broker-core/src/test/java...
Date Wed, 07 Dec 2016 17:46:36 GMT
Author: rgodfrey
Date: Wed Dec  7 17:46:36 2016
New Revision: 1773126

URL: http://svn.apache.org/viewvc?rev=1773126&view=rev
Log:
QPID-7580 : expose the message type in MessageInfo

Modified:
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/ServerMessage.java
    qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/internal/InternalMessage.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/message/AbstractServerMessageTest.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java
    qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/txn/MockServerMessage.java
    qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageTransferMessage.java
    qpid/java/trunk/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQMessage.java
    qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java
    qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/showMessage.html

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java?rev=1773126&r1=1773125&r2=1773126&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java
(original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfo.java
Wed Dec  7 17:46:36 2016
@@ -30,6 +30,7 @@ public interface MessageInfo
 {
     long getId();
     long getSize();
+    String getMessageType();
     int getDeliveryCount();
     String getState();
     String getDeliveredTo();

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java?rev=1773126&r1=1773125&r2=1773126&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java
(original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/MessageInfoImpl.java
Wed Dec  7 17:46:36 2016
@@ -48,6 +48,7 @@ public class MessageInfoImpl implements
     private final Map<String, Object> _headers;
     private final String _initialRoutingAddress;
     private final Date _notValidBefore;
+    private final String _messageType;
 
     public MessageInfoImpl(final MessageInstance instance, final boolean includeHeaders)
     {
@@ -57,6 +58,7 @@ public class MessageInfoImpl implements
         _deliveredTo = instance.getAcquiringConsumer() == null ? null : String.valueOf(instance.getAcquiringConsumer()
                                                                                         
       .getIdentifier());
         _arrivalTime = message.getArrivalTime() == 0L ? null : new Date(message.getArrivalTime());
+        _messageType = message.getMessageType();
         _persistent = message.isPersistent();
         _messageId = messageHeader.getMessageId();
         _expirationTime = messageHeader.getExpiration() == 0L ? null : new Date(messageHeader.getExpiration());
@@ -112,6 +114,12 @@ public class MessageInfoImpl implements
     }
 
     @Override
+    public String getMessageType()
+    {
+        return _messageType;
+    }
+
+    @Override
     public int getDeliveryCount()
     {
         return _deliveryCount;

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/ServerMessage.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/ServerMessage.java?rev=1773126&r1=1773125&r2=1773126&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/ServerMessage.java
(original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/ServerMessage.java
Wed Dec  7 17:46:36 2016
@@ -26,6 +26,8 @@ import org.apache.qpid.server.store.Tran
 
 public interface ServerMessage<T extends StorableMessageMetaData> extends EnqueueableMessage,
MessageContentSource
 {
+    String getMessageType();
+
     String getInitialRoutingAddress();
 
     AMQMessageHeader getMessageHeader();

Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/internal/InternalMessage.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/internal/InternalMessage.java?rev=1773126&r1=1773125&r2=1773126&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/internal/InternalMessage.java
(original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/message/internal/InternalMessage.java
Wed Dec  7 17:46:36 2016
@@ -45,6 +45,7 @@ import org.apache.qpid.util.ByteBufferUt
 
 public class InternalMessage extends AbstractServerMessageImpl<InternalMessage, InternalMessageMetaData>
 {
+    private static final String NON_AMQP_MESSAGE = "Non-AMQP Message";
     private final Object _messageBody;
     private InternalMessageHeader _header;
     private String _initialRoutingAddress;
@@ -100,6 +101,12 @@ public class InternalMessage extends Abs
     }
 
     @Override
+    public String getMessageType()
+    {
+        return NON_AMQP_MESSAGE;
+    }
+
+    @Override
     public long getArrivalTime()
     {
         return _header.getArrivalTime();

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/message/AbstractServerMessageTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/message/AbstractServerMessageTest.java?rev=1773126&r1=1773125&r2=1773126&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/message/AbstractServerMessageTest.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/message/AbstractServerMessageTest.java
Wed Dec  7 17:46:36 2016
@@ -60,6 +60,12 @@ public class AbstractServerMessageTest e
         }
 
         @Override
+        public String getMessageType()
+        {
+            return "test";
+        }
+
+        @Override
         public long getArrivalTime()
         {
             return 0;

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java?rev=1773126&r1=1773125&r2=1773126&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java
Wed Dec  7 17:46:36 2016
@@ -124,6 +124,12 @@ public class TestMessageMetaDataType imp
         }
 
         @Override
+        public String getMessageType()
+        {
+            return "test";
+        }
+
+        @Override
         public AMQMessageHeader getMessageHeader()
         {
             return null;

Modified: qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/txn/MockServerMessage.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/txn/MockServerMessage.java?rev=1773126&r1=1773125&r2=1773126&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/txn/MockServerMessage.java
(original)
+++ qpid/java/trunk/broker-core/src/test/java/org/apache/qpid/server/txn/MockServerMessage.java
Wed Dec  7 17:46:36 2016
@@ -109,6 +109,12 @@ class MockServerMessage implements Serve
     }
 
     @Override
+    public String getMessageType()
+    {
+        return "mock";
+    }
+
+    @Override
     public Collection<QpidByteBuffer> getContent(int offset, int length)
     {
         throw new UnsupportedOperationException();

Modified: qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageTransferMessage.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageTransferMessage.java?rev=1773126&r1=1773125&r2=1773126&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageTransferMessage.java
(original)
+++ qpid/java/trunk/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageTransferMessage.java
Wed Dec  7 17:46:36 2016
@@ -34,6 +34,7 @@ public class MessageTransferMessage exte
 {
 
     private final static MessageMetaData_0_10 DELETED_MESSAGE_METADATA = new MessageMetaData_0_10(null,
0, 0);
+    private static final String AMQP_0_10 = "AMQP 0-10";
 
     public MessageTransferMessage(StoredMessage<MessageMetaData_0_10> storeMessage,
Object connectionRef)
     {
@@ -68,6 +69,12 @@ public class MessageTransferMessage exte
         return getMetaData().getExpiration();
     }
 
+    @Override
+    public String getMessageType()
+    {
+        return AMQP_0_10;
+    }
+
     public long getArrivalTime()
     {
         return getMetaData().getArrivalTime();

Modified: qpid/java/trunk/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQMessage.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQMessage.java?rev=1773126&r1=1773125&r2=1773126&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQMessage.java
(original)
+++ qpid/java/trunk/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/AMQMessage.java
Wed Dec  7 17:46:36 2016
@@ -35,6 +35,7 @@ import org.apache.qpid.server.store.Tran
 public class AMQMessage extends AbstractServerMessageImpl<AMQMessage, MessageMetaData>
 {
     private static final MessageMetaData DELETED_MESSAGE_METADATA = new MessageMetaData(new
MessagePublishInfo(), new ContentHeaderBody(new BasicContentHeaderProperties()), 0);
+    private static final String AMQP_0_9_1 = "AMQP 0-9-1";
 
     public AMQMessage(StoredMessage<MessageMetaData> handle)
     {
@@ -108,5 +109,9 @@ public class AMQMessage extends Abstract
         return getMessageHeader().getExpiration();
     }
 
-
+    @Override
+    public String getMessageType()
+    {
+        return AMQP_0_9_1;
+    }
 }

Modified: qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java?rev=1773126&r1=1773125&r2=1773126&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java
(original)
+++ qpid/java/trunk/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java
Wed Dec  7 17:46:36 2016
@@ -23,7 +23,6 @@ package org.apache.qpid.server.protocol.
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
@@ -33,7 +32,6 @@ import org.apache.qpid.server.model.Queu
 import org.apache.qpid.server.protocol.v1_0.codec.QpidByteBufferUtils;
 import org.apache.qpid.server.protocol.v1_0.messaging.SectionDecoder;
 import org.apache.qpid.server.protocol.v1_0.messaging.SectionDecoderImpl;
-import org.apache.qpid.server.protocol.v1_0.messaging.SectionEncoderImpl;
 import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorException;
 import org.apache.qpid.server.protocol.v1_0.type.codec.AMQPDescribedTypeRegistry;
 import org.apache.qpid.server.protocol.v1_0.type.messaging.AmqpSequenceSection;
@@ -45,7 +43,6 @@ import org.apache.qpid.server.protocol.v
 import org.apache.qpid.server.protocol.v1_0.type.messaging.FooterSection;
 import org.apache.qpid.server.protocol.v1_0.type.messaging.HeaderSection;
 import org.apache.qpid.server.protocol.v1_0.type.messaging.MessageAnnotationsSection;
-import org.apache.qpid.server.protocol.v1_0.type.messaging.NonEncodingRetainingSection;
 import org.apache.qpid.server.protocol.v1_0.type.messaging.PropertiesSection;
 import org.apache.qpid.server.store.StoredMessage;
 import org.apache.qpid.server.store.TransactionLogResource;
@@ -55,11 +52,12 @@ public class Message_1_0 extends Abstrac
 {
 
     private static final AMQPDescribedTypeRegistry DESCRIBED_TYPE_REGISTRY = AMQPDescribedTypeRegistry.newInstance()
-            .registerTransportLayer()
-            .registerMessagingLayer()
-            .registerTransactionLayer()
-            .registerSecurityLayer();
-    public static final MessageMetaData_1_0 DELETED_MESSAGE_METADATA = new MessageMetaData_1_0(null,
null, null, null, null, null, 0L, 0L);
+                                                                                        
             .registerTransportLayer()
+                                                                                        
             .registerMessagingLayer()
+                                                                                        
             .registerTransactionLayer()
+                                                                                        
             .registerSecurityLayer();
+    private static final MessageMetaData_1_0 DELETED_MESSAGE_METADATA = new MessageMetaData_1_0(null,
null, null, null, null, null, 0L, 0L);
+    private static final String AMQP_1_0 = "AMQP 1.0";
 
     public Message_1_0(final StoredMessage<MessageMetaData_1_0> storedMessage)
     {
@@ -102,6 +100,12 @@ public class Message_1_0 extends Abstrac
         return getMessageMetaData().getMessageHeader().getExpiration();
     }
 
+    @Override
+    public String getMessageType()
+    {
+        return AMQP_1_0;
+    }
+
     public long getArrivalTime()
     {
         return getMessageMetaData().getArrivalTime();

Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/showMessage.html
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/showMessage.html?rev=1773126&r1=1773125&r2=1773126&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/showMessage.html
(original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/resources/showMessage.html
Wed Dec  7 17:46:36 2016
@@ -43,6 +43,10 @@
             <td><span class="message-correlationId"></span></td>
         </tr>
         <tr style="margin-bottom: 4pt">
+            <td style="width: 10em; vertical-align: top"><span style="font-weight:
bold;">Message Type:</span></td>
+            <td><span class="message-messageType"></span></td>
+        </tr>
+        <tr style="margin-bottom: 4pt">
             <td style="width: 10em; vertical-align: top"><span style="font-weight:
bold;">State:</span></td>
             <td><span class="message-state"></span></td>
         </tr>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message