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

Physical queues forwarded from many virtual destinations no longer supported

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.11.1
    • Fix Version/s: 5.13.0, 5.12.2
    • Component/s: None
    • Labels:
      None
    • Regression:
      Regression

      Description

      Hi Tim,

      AMQ-5187 breaks some of our message routing where we use virtual queues to control mirroring/replication of messages.

      A simple example...

      VIRTUAL.PUB.ALL
      -> queue://SUBSCRIBER1
      -> queue://SUBSCRIBER2
      
      VIRTUAL.PUB.SUBSCRIBER1
      -> queue://SUBSCRIBER1
      

      ...fails this assert because there are two composite destinations that route to queue://SUBSCRIBER1. With asserts disabled messages are routed as expected.

      I have attached a test case exemplifying this.

      We use layers of composite queues to achieve explicit routing of messages to either one consumer or all consumers, and (also with static subscriptions) to target optimal routes across a mixture of LAN and WAN links.

      Fully appreciate that subscription recovery from virtual topics of a mapped queue is a beneficial thing to do, however from our perspective it is also useful to retain the behaviour of being able to have a many-to-one mapping between composite queues and physical queues. For our own use case we don't have any requirement for subscription recovery - we require cast-iron guarantees around messaging so all messages persistent and are delivered to one or more physical queues on brokers with persistence enabled, so this obviates the need for subscription recovery.

      Could this validation relaxed, could it be made possible for the new behaviour to be disabled or do you have any suggestions as to how else we could achieve our use case?

      Thanks,
      James

        Issue Links

          Activity

          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 95f58fa7c4e26b5b2d73a80bd8e1cb2bee8ebf47 in activemq's branch refs/heads/master from Christopher L. Shannon
          [ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=95f58fa ]

          https://issues.apache.org/jira/browse/AMQ-6027

          Adding back in test case now that AMQ-5898 is resolved

          Show
          jira-bot ASF subversion and git services added a comment - Commit 95f58fa7c4e26b5b2d73a80bd8e1cb2bee8ebf47 in activemq's branch refs/heads/master from Christopher L. Shannon [ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=95f58fa ] https://issues.apache.org/jira/browse/AMQ-6027 Adding back in test case now that AMQ-5898 is resolved
          Hide
          furn James Furness added a comment -

          Great, thanks for your help.

          Show
          furn James Furness added a comment - Great, thanks for your help.
          Hide
          cshannon Christopher L. Shannon added a comment -

          I have applied a patch for this because the assertion doesn't make any sense to me to have it in there.

          Thanks for the test case James Furness, I have applied a modified version of it to this patch to make sure that this doesn't happen again.

          Show
          cshannon Christopher L. Shannon added a comment - I have applied a patch for this because the assertion doesn't make any sense to me to have it in there. Thanks for the test case James Furness , I have applied a modified version of it to this patch to make sure that this doesn't happen again.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit a38c3d4b6b9a4e828c80e88dd5a33c86fae99a06 in activemq's branch refs/heads/activemq-5.12.x from Christopher L. Shannon
          [ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=a38c3d4 ]

          https://issues.apache.org/jira/browse/AMQ-5898

          Removing assertion in VirtualDestinationInterceptor to allow
          multiple composite destinations to forward to a physical destination

          (cherry picked from commit 35b7ac250b5fa0b8c8dbf728881cc9dbf6edce19)

          Show
          jira-bot ASF subversion and git services added a comment - Commit a38c3d4b6b9a4e828c80e88dd5a33c86fae99a06 in activemq's branch refs/heads/activemq-5.12.x from Christopher L. Shannon [ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=a38c3d4 ] https://issues.apache.org/jira/browse/AMQ-5898 Removing assertion in VirtualDestinationInterceptor to allow multiple composite destinations to forward to a physical destination (cherry picked from commit 35b7ac250b5fa0b8c8dbf728881cc9dbf6edce19)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 35b7ac250b5fa0b8c8dbf728881cc9dbf6edce19 in activemq's branch refs/heads/master from Christopher L. Shannon
          [ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=35b7ac2 ]

          https://issues.apache.org/jira/browse/AMQ-5898

          Removing assertion in VirtualDestinationInterceptor to allow
          multiple composite destinations to forward to a physical destination

          Show
          jira-bot ASF subversion and git services added a comment - Commit 35b7ac250b5fa0b8c8dbf728881cc9dbf6edce19 in activemq's branch refs/heads/master from Christopher L. Shannon [ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=35b7ac2 ] https://issues.apache.org/jira/browse/AMQ-5898 Removing assertion in VirtualDestinationInterceptor to allow multiple composite destinations to forward to a physical destination
          Hide
          furn James Furness added a comment -

          Hi, yep passes with asserts disabled. We don't run our application with assertions turned on in production but we do for UAT and unit tests so would be good to get this fixed. Obviously the concern was that Timothy Bish added that assert to trap some undesirable edge case. If removing it is valid we'd be happy with this fix.

          Thanks,
          James

          Show
          furn James Furness added a comment - Hi, yep passes with asserts disabled. We don't run our application with assertions turned on in production but we do for UAT and unit tests so would be good to get this fixed. Obviously the concern was that Timothy Bish added that assert to trap some undesirable edge case. If removing it is valid we'd be happy with this fix. Thanks, James
          Hide
          cshannon Christopher L. Shannon added a comment -

          If you don't run with assertions turned on, does your use case work?

          It seems like the only fix here is to just drop the assertion line because I can't really think of a good reason not to allow multiple composite destinations to route to the same queue. In fact, I have done this several times but never noticed this problem because I don't use assertions accept during unit testing.

          Show
          cshannon Christopher L. Shannon added a comment - If you don't run with assertions turned on, does your use case work? It seems like the only fix here is to just drop the assertion line because I can't really think of a good reason not to allow multiple composite destinations to route to the same queue. In fact, I have done this several times but never noticed this problem because I don't use assertions accept during unit testing.
          Hide
          leebutts Lee Butts added a comment -

          Christopher L. Shannon this is a showstopper for us upgrading from 5.10 - could we get a fix for this into 5.13?

          Show
          leebutts Lee Butts added a comment - Christopher L. Shannon this is a showstopper for us upgrading from 5.10 - could we get a fix for this into 5.13?
          Hide
          furn James Furness added a comment -

          Add test case - passes with asserts disabled.

          With -ea fails:

          Caused by: java.lang.Throwable: java.lang.AssertionError: null
          	at org.apache.activemq.broker.region.virtual.VirtualDestinationInterceptor.intercept(VirtualDestinationInterceptor.java:70)
          	at org.apache.activemq.broker.region.CompositeDestinationInterceptor.intercept(CompositeDestinationInterceptor.java:38)
          	at org.apache.activemq.broker.region.AbstractRegion.addDestination(AbstractRegion.java:139)
          	at org.apache.activemq.broker.region.RegionBroker.addDestination(RegionBroker.java:348)
          	at org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:172)
          	at org.apache.activemq.advisory.AdvisoryBroker.addDestination(AdvisoryBroker.java:197)
          	at org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:172)
          	at org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:172)
          	at org.apache.activemq.broker.MutableBrokerFilter.addDestination(MutableBrokerFilter.java:177)
          	at org.apache.activemq.broker.region.AbstractRegion.lookup(AbstractRegion.java:467)
          	at org.apache.activemq.broker.region.AbstractRegion.addConsumer(AbstractRegion.java:261)
          	at org.apache.activemq.broker.region.RegionBroker.addConsumer(RegionBroker.java:427)
          	at org.apache.activemq.broker.jmx.ManagedRegionBroker.addConsumer(ManagedRegionBroker.java:244)
          	at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102)
          	at org.apache.activemq.advisory.AdvisoryBroker.addConsumer(AdvisoryBroker.java:104)
          	at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102)
          	at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102)
          	at org.apache.activemq.broker.MutableBrokerFilter.addConsumer(MutableBrokerFilter.java:107)
          	at org.apache.activemq.broker.TransportConnection.processAddConsumer(TransportConnection.java:663)
          	at org.apache.activemq.command.ConsumerInfo.visit(ConsumerInfo.java:348)
          	at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:334)
          	at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:188)
          	at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
          	at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
          	at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:270)
          	at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
          	at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214)
          	at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
          	... 1 more
          
          Show
          furn James Furness added a comment - Add test case - passes with asserts disabled. With -ea fails: Caused by: java.lang.Throwable: java.lang.AssertionError: null at org.apache.activemq.broker.region.virtual.VirtualDestinationInterceptor.intercept(VirtualDestinationInterceptor.java:70) at org.apache.activemq.broker.region.CompositeDestinationInterceptor.intercept(CompositeDestinationInterceptor.java:38) at org.apache.activemq.broker.region.AbstractRegion.addDestination(AbstractRegion.java:139) at org.apache.activemq.broker.region.RegionBroker.addDestination(RegionBroker.java:348) at org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:172) at org.apache.activemq.advisory.AdvisoryBroker.addDestination(AdvisoryBroker.java:197) at org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:172) at org.apache.activemq.broker.BrokerFilter.addDestination(BrokerFilter.java:172) at org.apache.activemq.broker.MutableBrokerFilter.addDestination(MutableBrokerFilter.java:177) at org.apache.activemq.broker.region.AbstractRegion.lookup(AbstractRegion.java:467) at org.apache.activemq.broker.region.AbstractRegion.addConsumer(AbstractRegion.java:261) at org.apache.activemq.broker.region.RegionBroker.addConsumer(RegionBroker.java:427) at org.apache.activemq.broker.jmx.ManagedRegionBroker.addConsumer(ManagedRegionBroker.java:244) at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102) at org.apache.activemq.advisory.AdvisoryBroker.addConsumer(AdvisoryBroker.java:104) at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102) at org.apache.activemq.broker.BrokerFilter.addConsumer(BrokerFilter.java:102) at org.apache.activemq.broker.MutableBrokerFilter.addConsumer(MutableBrokerFilter.java:107) at org.apache.activemq.broker.TransportConnection.processAddConsumer(TransportConnection.java:663) at org.apache.activemq.command.ConsumerInfo.visit(ConsumerInfo.java:348) at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:334) at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:188) at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50) at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113) at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:270) at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83) at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214) at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196) ... 1 more

            People

            • Assignee:
              cshannon Christopher L. Shannon
              Reporter:
              furn James Furness
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development