qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r887946 - in /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server: logging/messages/LogMessages_de_DE.properties message/MessageTransferHeader.java queue/AMQQueueMBean.java
Date Mon, 07 Dec 2009 15:14:52 GMT
Author: ritchiem
Date: Mon Dec  7 15:14:52 2009
New Revision: 887946

URL: http://svn.apache.org/viewvc?rev=887946&view=rev
Log:
QPID-2244 : Added initial support of 0-10 Messages via JMX viewMessages.
There are a still a few headers that need to be investigated and displayed.

Added:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_de_DE.properties
Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageTransferHeader.java
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java

Added: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_de_DE.properties
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_de_DE.properties?rev=887946&view=auto
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_de_DE.properties
(added)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/logging/messages/LogMessages_de_DE.properties
Mon Dec  7 15:14:52 2009
@@ -0,0 +1,81 @@
+#Broker
+# 0 - Version
+# 1 = Build
+BRK-1001 = Anfang : Version: {0} Bau: {1}
+# 0 - Transport
+# 1 - Port
+BRK-1002 = Starting : Listening on {0} port {1,number,#}
+# 0 - Transport
+# 1 - Port
+BRK-1003 = Shuting down : {0} port {1,number,#}
+BRK-1004 = Ready
+BRK-1005 = Stopped
+# 0 - path
+BRK-1006 = Using configuration : {0}
+# 0 - path
+BRK-1007 = Using logging configuration : {0}
+
+#ManagementConsole
+MNG-1001 = Startup
+# 0 - Service
+# 1 - Port
+MNG-1002 = Starting : {0} : Listening on port {1,number,#}
+# 0 - Service
+# 1 - Port
+MNG-1003 = Shuting down : {0} : port {1,number,#}
+MNG-1004 = Ready
+MNG-1005 = Stopped
+# 0 - Path
+MNG-1006 = Using SSL Keystore : {0}
+
+#VirtualHost
+# 0 - name
+VHT-1001 = Created : {0}
+VHT-1002 = Schliessen
+
+#MessageStore
+# 0 - name
+MST-1001 = Created : {0}
+# 0 - path
+MST-1002 = Store location : {0}
+MST-1003 = Schliessen
+# 0 - queue name
+MST-1004 = Recovery Anfang[ : {0}]
+# 0 - count
+# 1 - queue count
+MST-1005 = Recovered {0,number} messages for queue {1}
+# 0 - queue name
+MST-1006 = Recovery Complete[ : {0}]
+
+#Connection
+# 0 - Client id
+# 1 - Protocol Version
+CON-1001 = Oeffen : Client ID {0}[ : Protocol Version : {1}]
+CON-1002 = Schliessen
+
+#Channel
+# 0 - count
+CHN-1001 = Create : Prefetch {0, number}
+# 0 - flow
+CHN-1002 = Flow {0}
+CHN-1003 = Schliessen
+
+#Queue
+# 0 - owner
+# 1 - priority
+QUE-1001 = Create : Owner: {0}[ AutoDelete][ Durable][ Transient][ Priority: {1,number,#}]
+QUE-1002 = Deleted
+
+#Exchange
+# 0 - type
+# 1 - name
+EXH-1001 = Create :[ Durable] Type: {0} Name: {1}
+EXH-1002 = Deleted
+
+#Binding
+BND-1001 = Create[ : Arguments : {0}]
+BND-1002 = Deleted
+
+#Subscription
+SUB-1001 = Create[ : Durable][ : Arguments : {0}]
+SUB-1002 = Schliessen

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageTransferHeader.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageTransferHeader.java?rev=887946&r1=887945&r2=887946&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageTransferHeader.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageTransferHeader.java
Mon Dec  7 15:14:52 2009
@@ -44,7 +44,14 @@
 
     public String getCorrelationId()
     {
-        return _messageProps == null ? null : new String(_messageProps.getCorrelationId());
+        if (_messageProps != null && _messageProps.getCorrelationId() != null)
+        {
+            return new String(_messageProps.getCorrelationId());
+        }
+        else
+        {
+            return null;
+        }
     }
 
     public long getExpiration()
@@ -88,7 +95,14 @@
 
     public String getReplyTo()
     {
-        return _messageProps == null ? null : _messageProps.getReplyTo().toString();
+        if (_messageProps != null && _messageProps.getReplyTo() != null)
+        {
+            return _messageProps.getReplyTo().toString();
+        }
+        else
+        {
+            return null;
+        }
     }
 
     public Object getHeader(String name)

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java?rev=887946&r1=887945&r2=887946&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
Mon Dec  7 15:14:52 2009
@@ -33,6 +33,7 @@
 import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.message.AMQMessageHeader;
 import org.apache.qpid.server.message.AMQMessage;
+import org.apache.qpid.server.message.MessageTransferMessage;
 import org.apache.qpid.server.txn.ServerTransaction;
 import org.apache.qpid.server.txn.LocalTransaction;
 
@@ -403,13 +404,25 @@
                     ContentHeaderBody headerBody = msg.getContentHeaderBody();
                     // Create header attributes list
                     String[] headerAttributes = getMessageHeaderProperties(headerBody);
-                    Object[] itemValues = { msg.getMessageId(), headerAttributes, headerBody.bodySize,
queueEntry.isRedelivered(), position};
+                    Object[] itemValues = {msg.getMessageId(), headerAttributes, headerBody.bodySize,
queueEntry.isRedelivered(), position};
                     CompositeData messageData = new CompositeDataSupport(_messageDataType,
VIEW_MSGS_COMPOSITE_ITEM_NAMES, itemValues);
                     _messageList.put(messageData);
+
                 }
                 else
                 {
-                    // TODO 0-10 Message
+                    // We have a 0-10 message
+                    if (serverMsg instanceof MessageTransferMessage)
+                    {
+                        MessageTransferMessage msg = (MessageTransferMessage) serverMsg;
+
+                        AMQMessageHeader header = msg.getMessageHeader();
+                        // Create header attributes list
+                        String[] headerAttributes = getAMQMessageHeaderProperties(header);
+                        Object[] itemValues = {msg.getMessageNumber(), headerAttributes,
msg.getSize(), queueEntry.isRedelivered(), position};
+                        CompositeData messageData = new CompositeDataSupport(_messageDataType,
VIEW_MSGS_COMPOSITE_ITEM_NAMES, itemValues);
+                        _messageList.put(messageData);
+                    }
                 }
             }
         }
@@ -453,6 +466,37 @@
         return list.toArray(new String[list.size()]);
     }
 
+    private String[] getAMQMessageHeaderProperties(AMQMessageHeader header)
+    {
+        List<String> list = new ArrayList<String>();
+
+        list.add("reply-to = " + header.getReplyTo());
+        //TODO - Complete header property extraction
+//        list.add("propertyFlags = " + header.getgetPropertyFlags());
+//        list.add("ApplicationID = " + header.getAppIdAsString());
+//        list.add("ClusterID = " + header.getClusterIdAsString());
+//        list.add("UserId = " + header.getUserIdAsString());
+        list.add("JMSMessageID = " + header.getMessageId());
+        list.add("JMSCorrelationID = " + header.getCorrelationId());
+        
+//        int delMode = header.getDeliveryMode();
+//        list.add("JMSDeliveryMode = " +
+//                 ((delMode == BasicContentHeaderProperties.PERSISTENT) ? "Persistent" :
"Non_Persistent"));
+
+        list.add("JMSPriority = " + header.getPriority());
+        list.add("JMSType = " + header.getType());
+
+        long longDate = header.getExpiration();
+        String strDate = (longDate != 0) ? _dateFormat.format(new Date(longDate)) : null;
+        list.add("JMSExpiration = " + strDate);
+
+        longDate = header.getTimestamp();
+        strDate = (longDate != 0) ? _dateFormat.format(new Date(longDate)) : null;
+        list.add("JMSTimestamp = " + strDate);
+
+        return list.toArray(new String[list.size()]);
+    }
+
     /**
      * @see ManagedQueue#moveMessages
      * @param fromMessageId



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message