Details
Description
Tried upgrading to 5.1 today. Seems virtual topics are broken with more than one different consumer name/queue. This is a show-stopper for us as we're using this feature fairly heavily in 4.1 (with some issues, but none like this).
ERROR Service - Async error occurred: java.lang.ClassCastException: org.apache.activemq.broker.region.Topic cannot be cast to org.apache.activemq.broker.region.Queue
java.lang.ClassCastException: org.apache.activemq.broker.region.Topic cannot be cast to org.apache.activemq.broker.region.Queue
at org.apache.activemq.broker.region.QueueSubscription.acknowledge(QueueSubscription.java:50)
at org.apache.activemq.broker.region.PrefetchSubscription.acknowledge(PrefetchSubscription.java:224)
at org.apache.activemq.broker.region.AbstractRegion.acknowledge(AbstractRegion.java:359)
at org.apache.activemq.broker.region.RegionBroker.acknowledge(RegionBroker.java:470)
at org.apache.activemq.broker.TransactionBroker.acknowledge(TransactionBroker.java:194)
at org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:73)
at org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:73)
at org.apache.activemq.broker.MutableBrokerFilter.acknowledge(MutableBrokerFilter.java:84)
at org.apache.activemq.broker.TransportConnection.processMessageAck(TransportConnection.java:443)
at org.apache.activemq.command.MessageAck.visit(MessageAck.java:196)
at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:292)
at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:180)
at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)
at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:143)
at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:206)
at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:196)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:183)
at java.lang.Thread.run(Thread.java:619)
This can be reproduced by modifying the existing VirtualTopicPubSubTest as attached (have two different consumer names). I could not get it to error with an internal broker. The easiest way to reproduce is to start an external broker and then run the attached test. It seems to be important that the broker start clean.