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

virtualSelectorCacheBrokerPlugin is not working properly

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 5.10.0
    • None
    • None
    • None

    Description

      The issue is still persist and below is the scenario.
      I am using activemq 5.10 version.For publishing message am using VirtualTopic and also have <virtualTopic selectorAware="true"/> in broker xml.
      I have a consumer queue which consume message from this virtual topic.All the things work fine when the my consumer is up but once the consumer goes down or not active I am loosing the message.After configuring <virtualSelectorCacheBrokerPlugin/> in broker.xml I am getting below error on activemq log console. I have attached my activemq broker config file.
      jvm 1 | ERROR | Unable to read persisted selector cache...it will be ignored!
      jvm 1 | java.io.EOFException
      jvm 1 | at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)[:1.8.0_101]
      jvm 1 | at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)[:1.8.0_101]
      jvm 1 | at java.io.ObjectInputStream.readStreamHeader(Unknown Source)[:1.8.0_101]
      jvm 1 | at java.io.ObjectInputStream.<init>(Unknown Source)[:1.8.0_101]
      jvm 1 | at org.apache.activemq.plugin.SubQueueSelectorCacheBroker.readCache(SubQueueSelectorCacheBroker.java:115)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.plugin.SubQueueSelectorCacheBroker.<init>(SubQueueSelectorCacheBroker.java:74)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.plugin.SubQueueSelectorCacheBrokerPlugin.installPlugin(SubQueueSelectorCacheBrokerPlugin.java:42)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.broker.BrokerService.addInterceptors(BrokerService.java:2295)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:2156)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:937)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:2426)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.broker.BrokerService.startVirtualConsumerDestinations(BrokerService.java:2566)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:2417)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.broker.BrokerService.doStartBroker(BrokerService.java:667)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.broker.BrokerService.startBroker(BrokerService.java:659)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.broker.BrokerService.start(BrokerService.java:595)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:73)[activemq-spring-5.10.0.jar:5.10.0]
      jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_101]
      jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_101]
      jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_101]
      jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)[:1.8.0_101]
      jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1638)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      jvm 1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      jvm 1 | at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      jvm 1 | at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      jvm 1 | at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      jvm 1 | at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      jvm 1 | at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      jvm 1 | at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      jvm 1 | at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)[spring-context-3.2.8.RELEASE.jar:3.2.8.RELEASE]
      jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)[xbean-spring-3.16.jar:3.16]
      jvm 1 | at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)[xbean-spring-3.16.jar:3.16]
      jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory$1.<init>(XBeanBrokerFactory.java:104)[activemq-spring-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:104)[activemq-spring-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:67)[activemq-spring-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)[activemq-broker-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:87)[activemq-console-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)[activemq-console-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:150)[activemq-console-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:57)[activemq-console-5.10.0.jar:5.10.0]
      jvm 1 | at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:104)[activemq-console-5.10.0.jar:5.10.0]
      jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_101]
      jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_101]
      jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_101]
      jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)[:1.8.0_101]
      jvm 1 | at org.apache.activemq.console.Main.runTaskClass(Main.java:262)[activemq.jar:5.10.0]
      jvm 1 | at org.apache.activemq.console.Main.main(Main.java:115)[activemq.jar:5.10.0]
      jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_101]
      jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_101]
      jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)[:1.8.0_101]
      jvm 1 | at java.lang.reflect.Method.invoke(Unknown Source)[:1.8.0_101]
      jvm 1 | at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)[wrapper.jar:3.2.3]

      Attachments

        1. activemq.xml
          10 kB
          S Boot

        Issue Links

          Activity

            5.10.0 is very old and no patch releases are going to be done for that version, instead you should use the latest release 5.14.0 first and see if the problem persists, then if you still have an issue create a unit test that can reproduce it.

            tabish Timothy A. Bish added a comment - 5.10.0 is very old and no patch releases are going to be done for that version, instead you should use the latest release 5.14.0 first and see if the problem persists, then if you still have an issue create a unit test that can reproduce it.
            bhuman.vyas@gmail.com S Boot added a comment -

            Thanks Timothy for reply.
            I will try with the latest release and post the result.

            bhuman.vyas@gmail.com S Boot added a comment - Thanks Timothy for reply. I will try with the latest release and post the result.
            bhuman.vyas@gmail.com S Boot added a comment -

            Hi Timothy,
            The scenario works fine with the 5.14.0 with virtualSelectorCacheBrokerPlugin. I want to know that is that possible to store message(offline message when broker goes down) in db instead of selector.data file?

            bhuman.vyas@gmail.com S Boot added a comment - Hi Timothy, The scenario works fine with the 5.14.0 with virtualSelectorCacheBrokerPlugin. I want to know that is that possible to store message(offline message when broker goes down) in db instead of selector.data file?

            The data file is the only mechanism for storage at the moment.

            tabish Timothy A. Bish added a comment - The data file is the only mechanism for storage at the moment.

            People

              Unassigned Unassigned
              bhuman.vyas@gmail.com S Boot
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: