Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 62414 invoked from network); 24 Jun 2008 16:36:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jun 2008 16:36:50 -0000 Received: (qmail 57313 invoked by uid 500); 24 Jun 2008 16:36:52 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 57150 invoked by uid 500); 24 Jun 2008 16:36:51 -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 57139 invoked by uid 99); 24 Jun 2008 16:36:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jun 2008 09:36:51 -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: local policy) Received: from [72.22.94.67] (HELO virtual.halosg.com) (72.22.94.67) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jun 2008 16:36:01 +0000 Received: (qmail 18372 invoked from network); 24 Jun 2008 11:36:17 -0500 Received: from 72-19-171-38.static.mesanetworks.net (HELO ?192.168.1.3?) (72.19.171.38) by halosg.com with SMTP; 24 Jun 2008 11:36:17 -0500 Message-ID: <486122CC.90100@hanik.com> Date: Tue, 24 Jun 2008 10:37:32 -0600 From: Filip Hanik - Dev Lists User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: dev@activemq.apache.org Subject: Re: spec violation(?)-Temporary queue creation based on name References: <48611401.707@hanik.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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); >> > > >