From dev-return-11294-apmail-activemq-dev-archive=activemq.apache.org@activemq.apache.org Thu Jun 26 23:06:24 2008 Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 48772 invoked from network); 26 Jun 2008 23:06:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Jun 2008 23:06:24 -0000 Received: (qmail 24164 invoked by uid 500); 26 Jun 2008 23:06:25 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 24143 invoked by uid 500); 26 Jun 2008 23:06:25 -0000 Mailing-List: contact dev-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 dev@activemq.apache.org Received: (qmail 24132 invoked by uid 99); 26 Jun 2008 23:06:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jun 2008 16:06:25 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of chirino@gmail.com designates 209.85.146.179 as permitted sender) Received: from [209.85.146.179] (HELO wa-out-1112.google.com) (209.85.146.179) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jun 2008 23:05:32 +0000 Received: by wa-out-1112.google.com with SMTP id k17so149993waf.0 for ; Thu, 26 Jun 2008 16:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=8hG8NRkCA7HwBF2RJj6XOk8HSbRk85i0qYmf3L40Mo0=; b=bq5tBosVarQchaKNxtNcce+/40+lrmcOhM51oXI8TpuJy+0XID4AkYD0U61cVz8bWC /xzAPAJTMRunCcOBt6gkfwhzNIzGmN+/5gMdL/Ba92SQur0BOFX+Hjyj9ixCv149UKD5 38bkI5uRun5r+hPmuynKUvjLVsWbfoQPSUzQA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=I3X7cb0QlyHuU5DetWKC707ISveAjCLmQf2r+TURoR19Z1D0OyGMtsm++QfS3Jv0N6 wTZ9k8r15zXD46GKr14iLnP2vGzXJ+d4LQJyoVG41FsuPLiiGIygnierC1ZDaMDgw3E3 v0O8uRg85PWf1wsAICDn+/pWKqxihRhikKc/E= Received: by 10.114.196.13 with SMTP id t13mr676325waf.219.1214521550953; Thu, 26 Jun 2008 16:05:50 -0700 (PDT) Received: by 10.114.160.6 with HTTP; Thu, 26 Jun 2008 16:05:50 -0700 (PDT) Message-ID: Date: Thu, 26 Jun 2008 18:05:50 -0500 From: "Hiram Chirino" Sender: chirino@gmail.com To: dev@activemq.apache.org Subject: Re: spec violation(?)-Temporary queue creation based on name In-Reply-To: <20C1FC7E-009E-4C5C-9059-9186B694F1CA@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48611401.707@hanik.com> <486122CC.90100@hanik.com> <20C1FC7E-009E-4C5C-9059-9186B694F1CA@gmail.com> X-Google-Sender-Auth: 2eb56eecc3179d8d X-Virus-Checked: Checked by ClamAV on apache.org Perhaps we should throw a JMSException in the createTopic if an invalid (temp topic) name is used. That would be much more spec compliant. On Tue, Jun 24, 2008 at 1:29 PM, Rob Davies wrote: > damn! :) > On 24 Jun 2008, at 17:37, Filip Hanik - Dev Lists wrote: > >> ok, all I have to do is this >> >> javax.jms.Session.createTopic("ID:/mytopic"); >> >> and activeMQ creates a temp topic, >> >> how is that non JMS API? >> >> Filip >> >> Rob Davies wrote: >>> >>> How does that violate the spec - when you are using non JMS API's to get >>> that info ? >>> >>> On 24 Jun 2008, at 16:34, Filip Hanik - Dev Lists wrote: >>> >>>> The fix to >>>> http://issues.apache.org/activemq/browse/AMQ-1142 >>>> >>>> in revision: >>>> http://svn.apache.org/viewvc?view=rev&revision=546476 >>>> >>>> causes the queue or topic creation to use the name to determine if it is >>>> supposed to be temporary or not, ignoring the call the client is making. >>>> >>>> This simple test case >>>> >>>> String connectionId = >>>> connection.getConnectionInfo().getConnectionId().toString(); >>>> topic = session.createTopic(connectionId); >>>> >>>> returns a temporary topic, even though the API call was explicit it >>>> didn't want a temp topic. >>>> >>>> I would say that this must violate the spec, that a temp queue is >>>> created when using an explicit API call to to create a regular one. >>>> >>>> A quick fix would be to simply allow a system property to control the >>>> behavior (as seen below), but I will take a deeper look into 1142, and see >>>> if I can understand why this behavior was put into the session >>>> >>>> Filip >>>> >>>> >>>> Index: >>>> activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java >>>> =================================================================== >>>> --- activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java >>>> (revision 669337) >>>> +++ activemq-core/src/main/java/org/apache/activemq/ActiveMQSession.java >>>> (working copy) >>>> @@ -141,6 +141,9 @@ >>>> */ >>>> public static final int INDIVIDUAL_ACKNOWLEDGE=4; >>>> >>>> + public static final boolean STRICT_DESTINATION_CREATION = >>>> + >>>> Boolean.getBoolean(System.getProperty("org.apache.activemq.STRICT_DESTINATION_CREATION", >>>> "false")); >>>> + >>>> public static interface DeliveryListener { >>>> void beforeDelivery(ActiveMQSession session, Message msg); >>>> >>>> @@ -1040,7 +1043,7 @@ >>>> */ >>>> public Queue createQueue(String queueName) throws JMSException { >>>> checkClosed(); >>>> - if >>>> (queueName.startsWith(ActiveMQDestination.TEMP_DESTINATION_NAME_PREFIX)) { >>>> + if >>>> (queueName.startsWith(ActiveMQDestination.TEMP_DESTINATION_NAME_PREFIX) && >>>> (!STRICT_DESTINATION_CREATION)) { >>>> >>>> return new ActiveMQTempQueue(queueName); >>>> } >>>> return new ActiveMQQueue(queueName); >>>> @@ -1066,9 +1069,11 @@ >>>> * internal error. >>>> * @since 1.1 >>>> */ >>>> + >>>> + >>>> public Topic createTopic(String topicName) throws JMSException { >>>> checkClosed(); >>>> - if >>>> (topicName.startsWith(ActiveMQDestination.TEMP_DESTINATION_NAME_PREFIX)) { >>>> + if >>>> (topicName.startsWith(ActiveMQDestination.TEMP_DESTINATION_NAME_PREFIX) && >>>> (!STRICT_DESTINATION_CREATION)) { >>>> >>>> return new ActiveMQTempTopic(topicName); >>>> } >>>> return new ActiveMQTopic(topicName); >>>> >>> >>> >>> >> > > -- Regards, Hiram Blog: http://hiramchirino.com Open Source SOA http://open.iona.com