Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-3060

java.lang.ClassCastException: org.apache.activemq.broker.region.QueueSubscription cannot be cast to org.apache.activemq.broker.region.DurableTopicSubscription

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 5.4.1
    • 5.7.0
    • None
    • None

    Description

      I've been asked to create an issue about this, see:

      http://activemq.2283324.n4.nabble.com/Selected-messages-not-being-passed-between-brokers-td3058921.html
      http://activemq.2283324.n4.nabble.com/SOLVED-Re-Selected-messages-not-being-passed-between-brokers-td3062303.html

      It would be very helpful to engineering staff if the following exception were given a description to help fix the cause:

      2010-11-25 03:16:06,111 | ERROR | Failed to register subscription QueueSubscription: consumer=ID:zorin-38906-1288633023389-566:1:1:167, destinations=0, dispatched=0, delivered=0, pending=0 | org.apache.activemq.broker.jmx.ManagedRegionBroker | ActiveMQ Transport: ssl://my-host.net/a.b.c.d:61617
      java.lang.ClassCastException: org.apache.activemq.broker.region.QueueSubscription cannot be cast to org.apache.activemq.broker.region.DurableTopicSubscription
      at org.apache.activemq.broker.jmx.DurableSubscriptionView.<init>(DurableSubscriptionView.java:46)
      at org.apache.activemq.broker.jmx.ManagedRegionBroker.registerSubscription(ManagedRegionBroker.java:188)
      at org.apache.activemq.broker.jmx.ManagedQueueRegion.createSubscription(ManagedQueueRegion.java:45)
      at org.apache.activemq.broker.region.AbstractRegion.addConsumer(AbstractRegion.java:268)
      at org.apache.activemq.broker.region.RegionBroker.addConsumer(RegionBroker.java:443)
      at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:89)
      at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:89)
      at org.apache.activemq.advisory.AdvisoryBroker.addConsumer(AdvisoryBroker.java:91)
      at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:89)
      at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:89)
      at org.apache.activemq.broker.MutableBrokerFilter.addConsumer(MutableBrokerFilter.java:95)
      at org.apache.activemq.broker.TransportConnection.processAddConsumer(TransportConnection.java:548)
      at org.apache.activemq.command.ConsumerInfo.visit(ConsumerInfo.java:349)
      at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:309)
      at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:185)
      at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116)
      at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69)
      at org.apache.activemq.transport.vm.VMTransport.dispatch(VMTransport.java:121)
      at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:112)
      at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40)
      at org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60)
      at org.apache.activemq.network.DemandForwardingBridgeSupport.addSubscription(DemandForwardingBridgeSupport.java:658)
      at org.apache.activemq.network.DemandForwardingBridgeSupport.addConsumerInfo(DemandForwardingBridgeSupport.java:1023)
      at org.apache.activemq.network.DemandForwardingBridgeSupport.serviceRemoteConsumerAdvisory(DemandForwardingBridgeSupport.java:593)
      at org.apache.activemq.network.DemandForwardingBridgeSupport.serviceRemoteCommand(DemandForwardingBridgeSupport.java:492)
      at org.apache.activemq.network.DemandForwardingBridgeSupport$2.onCommand(DemandForwardingBridgeSupport.java:173)
      at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116)
      at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:69)
      at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
      at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:228)
      at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
      at org.apache.activemq.transport.tcp.SslTransport.doConsume(SslTransport.java:91)
      at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:219)
      at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:201)
      at java.lang.Thread.run(Thread.java:619)

      In this case I was attempting to subscribe to a queue while also giving connection and subscription headers to make my client into a durable topic subscriber. Remove these extra headers and the error above goes away.

      If it is any help, messages are created on broker A (where the log above originates) and consumed on broker B. Brokers A and B are SSL connected.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jgreen James Green
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: