Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 42826 invoked from network); 13 Mar 2009 12:59:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Mar 2009 12:59:11 -0000 Received: (qmail 27875 invoked by uid 500); 13 Mar 2009 12:59:10 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 27847 invoked by uid 500); 13 Mar 2009 12:59:10 -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 27836 invoked by uid 99); 13 Mar 2009 12:59:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2009 05:59:10 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2009 12:59:02 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B8F42234C045 for ; Fri, 13 Mar 2009 05:58:41 -0700 (PDT) Message-ID: <1113021381.1236949121754.JavaMail.jira@brutus> Date: Fri, 13 Mar 2009 05:58:41 -0700 (PDT) From: "Gary Tully (JIRA)" To: dev@activemq.apache.org Subject: [jira] Assigned: (AMQ-2144) Can't unsubscribe a durable subscription when there's a virtual topic present on the broker In-Reply-To: <1622677766.1235676960005.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-2144?page=3Dcom.atlass= ian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gary Tully reassigned AMQ-2144: ------------------------------- Assignee: Gary Tully > Can't unsubscribe a durable subscription when there's a virtual topic pre= sent on the broker > -------------------------------------------------------------------------= ------------------ > > Key: AMQ-2144 > URL: https://issues.apache.org/activemq/browse/AMQ-2144 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Affects Versions: 5.2.0 > Environment: Ubuntu > Reporter: Cl=C3=A1udio de Miranda Luz > Assignee: Gary Tully > Attachments: AMQ-2144.txt > > > The scenario is: > There's a virtual topic being used. (i.e. topic VirtualTopic.Orders). > A consumer subscribes to any topic present on the broker and after some t= ime it tries to unsubscribe the durable subscription. > When it calls session.unsubscribe(consumerName) to unsubscribe a durable = subscription, it receives the following exception: > Caught: javax.jms.JMSException: org.apache.activemq.broker.region.virtual= .VirtualTopicInterceptor cannot be cast to org.apache.activemq.broker.regio= n.Topic > javax.jms.JMSException: org.apache.activemq.broker.region.virtual.Virtual= TopicInterceptor cannot be cast to org.apache.activemq.broker.region.Topic > =09at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSup= port.java:49) > =09at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConne= ction.java:1244) > =09at org.apache.activemq.ActiveMQConnection.unsubscribe(ActiveMQConnecti= on.java:2052) > =09at org.apache.activemq.ActiveMQSession.unsubscribe(ActiveMQSession.jav= a:1431) > =09at DurableSubscriber.consumeMessagesAndClose(DurableSubscriber.java:20= 6) > =09at DurableSubscriber.run(DurableSubscriber.java:112) > =09at DurableSubscriber.main(DurableSubscriber.java:70) > Caused by: java.lang.ClassCastException: org.apache.activemq.broker.regio= n.virtual.VirtualTopicInterceptor cannot be cast to org.apache.activemq.bro= ker.region.Topic > =09at org.apache.activemq.broker.region.TopicRegion.removeSubscription(To= picRegion.java:139) > =09at org.apache.activemq.broker.region.RegionBroker.removeSubscription(R= egionBroker.java:409) > =09at org.apache.activemq.broker.BrokerFilter.removeSubscription(BrokerFi= lter.java:98) > =09at org.apache.activemq.broker.BrokerFilter.removeSubscription(BrokerFi= lter.java:98) > =09at org.apache.activemq.broker.BrokerFilter.removeSubscription(BrokerFi= lter.java:98) > =09at org.apache.activemq.broker.MutableBrokerFilter.removeSubscription(M= utableBrokerFilter.java:105) > =09at org.apache.activemq.broker.TransportConnection.processRemoveSubscri= ption(TransportConnection.java:339) > =09at org.apache.activemq.command.RemoveSubscriptionInfo.visit(RemoveSubs= criptionInfo.java:83) > =09at org.apache.activemq.broker.TransportConnection.service(TransportCon= nection.java:305) > =09at org.apache.activemq.broker.TransportConnection$1.onCommand(Transpor= tConnection.java:179) > =09at org.apache.activemq.transport.TransportFilter.onCommand(TransportFi= lter.java:68) > =09at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFo= rmatNegotiator.java:143) > =09at org.apache.activemq.transport.InactivityMonitor.onCommand(Inactivit= yMonitor.java:206) > =09at org.apache.activemq.transport.TransportSupport.doConsume(TransportS= upport.java:84) > =09at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.j= ava:203) > =09at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.jav= a:185) > =09at java.lang.Thread.run(Thread.java:619) > The error happens on the following method of org.apache.activemq.broker.r= egion.TopicRegion class: > public void removeSubscription(ConnectionContext context, RemoveSubsc= riptionInfo info) throws Exception { > SubscriptionKey key =3D new SubscriptionKey(info.getClientId(), i= nfo.getSubscriptionName()); > DurableTopicSubscription sub =3D durableSubscriptions.get(key); > if (sub =3D=3D null) { > throw new InvalidDestinationException("No durable subscriptio= n exists for: " + info.getSubscriptionName()); > } > if (sub.isActive()) { > throw new JMSException("Durable consumer is in use"); > } > durableSubscriptions.remove(key); > synchronized (destinationsMutex) { > for (Iterator iter =3D destinations.values().ite= rator(); iter.hasNext();) { > Topic topic =3D (Topic)iter.next(); > topic.deleteSubscription(context, key); > } > } > super.removeConsumer(context, sub.getConsumerInfo()); > } > The virtual topic is present on the destinations collection being iterate= d but its type is not Topic and that is what causes the error. > If there is no virtual topics present on the broker, unsubscriptions work= well. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.