Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 656CAD3DB for ; Wed, 12 Dec 2012 21:34:16 +0000 (UTC) Received: (qmail 54625 invoked by uid 500); 12 Dec 2012 21:34:16 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 54594 invoked by uid 500); 12 Dec 2012 21:34:16 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 54585 invoked by uid 99); 12 Dec 2012 21:34:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2012 21:34:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2012 21:34:13 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id AA2F823889FD; Wed, 12 Dec 2012 21:33:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1420984 - /activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireMessage.scala Date: Wed, 12 Dec 2012 21:33:52 -0000 To: commits@activemq.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121212213352.AA2F823889FD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: chirino Date: Wed Dec 12 21:33:50 2012 New Revision: 1420984 URL: http://svn.apache.org/viewvc?rev=1420984&view=rev Log: Properly map JMS property names to message fields so that selectors work. Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireMessage.scala Modified: activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireMessage.scala URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireMessage.scala?rev=1420984&r1=1420983&r2=1420984&view=diff ============================================================================== --- activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireMessage.scala (original) +++ activemq/activemq-apollo/trunk/apollo-openwire/src/main/scala/org/apache/activemq/apollo/openwire/OpenwireMessage.scala Wed Dec 12 21:33:50 2012 @@ -20,10 +20,8 @@ import org.apache.activemq.apollo.broker import java.lang.{String, Class} import org.fusesource.hawtdispatch.BaseRetained import org.fusesource.hawtbuf.Buffer._ -import OpenwireConstants._ import org.fusesource.hawtbuf.{UTF8Buffer, AsciiBuffer, Buffer} import command.{ActiveMQBytesMessage, ActiveMQTextMessage, ActiveMQMessage} -import org.apache.activemq.apollo.broker.protocol.Protocol /** *

@@ -35,7 +33,42 @@ class OpenwireMessage(val message:Active val _id = ascii(message.getMessageId.toString) - def getProperty(name: String) = message.getProperty(name) + def toString(buffer:AnyRef) = if (buffer==null) null else buffer.toString + + def getProperty(name: String) = { + name match { + case "JMSDeliveryMode" => + if( message.isPersistent) "PERSISTENT" else "NON_PERSISTENT" + case "JMSPriority" => + new java.lang.Integer(message.getPriority) + case "JMSType" => + toString(message.getType) + case "JMSMessageID" => + toString(message.getMessageId) + case "JMSDestination" => + toString(message.getDestination) + case "JMSReplyTo" => + toString(message.getReplyTo) + case "JMSCorrelationID" => + toString(message.getCorrelationId) + case "JMSExpiration" => + new java.lang.Long(message.getExpiration) + case "JMSXDeliveryCount" => + new java.lang.Integer(message.getRedeliveryCounter) + case "JMSXUserID" => + toString(message.getUserID) + case "JMSXGroupID" => + toString(message.getGroupID) + case "JMSXGroupSeq" => + if ( message.getGroupID!=null ) { + new java.lang.Integer(message.getGroupSequence) + } else { + null + } + case x => + message.getProperty(name) + } + } def getLocalConnectionId = message.getProducerId.getConnectionId