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

scheduled delivery not work when persistent="false" schedulerSupport="true"

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 5.9.0
    • None
    • Broker
    • None
    • Patch Available

    Description

      with version 5.9, when configured in activemq.xml with: persistent="false" schedulerSupport="true", scheduled delivery does NOT work. The message is immediately ready for delivery,
      Here is my fix, please review it and make it official.

      diff ../activemq-parent-5.9.0/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java My_BrokerService.java
      647c647
      < LOG.info("Apache ActiveMQ {} ({}, {}) is starting", new Object[]

      { getBrokerVersion(), getBrokerName(), brokerId });

      > LOG.info("Modified Apache ActiveMQ {} ({}, {}) is starting", new Object[]{ getBrokerVersion(), getBrokerName(), brokerId }

      );
      1806c1806,1807
      < if (!isSchedulerSupport()) {

      > //if (!isSchedulerSupport()) @BOXU: always true, if !isPersistent()
      > if (!this.schedulerSupport) {
      1814,1816c1815
      < if (!isPersistent())

      { < return null; < }


      > if (isPersistent()) {
      1818,1821c1817,1835
      < try {
      < PersistenceAdapter pa = getPersistenceAdapter();
      < if (pa != null && pa instanceof JobSchedulerStore) {
      < this.jobSchedulerStore = (JobSchedulerStore) pa;

      > try {
      > PersistenceAdapter pa = getPersistenceAdapter();
      > if (pa != null && pa instanceof JobSchedulerStore)

      { > this.jobSchedulerStore = (JobSchedulerStore) pa; > configureService(jobSchedulerStore); > return this.jobSchedulerStore; > }

      > //else return null;
      > } catch (IOException e)

      { > throw new RuntimeException(e); > }

      > }
      > else {
      > LOG.info("Creating user configured jobSchedulerStore, fixed by BOXU, Paypal");
      >
      > try {
      > String clazz = "org.apache.activemq.store.kahadb.scheduler.JobSchedulerStoreImpl";
      > jobSchedulerStore = (JobSchedulerStore) getClass().getClassLoader().loadClass(clazz).newInstance();
      > jobSchedulerStore.setDirectory(getSchedulerDirectoryFile());
      1823c1837,1840
      < return this.jobSchedulerStore;

      > jobSchedulerStore.start();
      > LOG.info("JobScheduler using directory: {}", getSchedulerDirectoryFile());
      > } catch (Exception e)

      { > throw new RuntimeException(e); 1825,1837d1841 < }

      catch (IOException e)

      { < throw new RuntimeException(e); < }

      <
      < try {
      < String clazz = "org.apache.activemq.store.kahadb.scheduler.JobSchedulerStoreImpl";
      < jobSchedulerStore = (JobSchedulerStore) getClass().getClassLoader().loadClass(clazz).newInstance();
      < jobSchedulerStore.setDirectory(getSchedulerDirectoryFile());
      < configureService(jobSchedulerStore);
      < jobSchedulerStore.start();
      < LOG.info("JobScheduler using directory: {}", getSchedulerDirectoryFile());
      < } catch (Exception e) {
      < throw new RuntimeException(e);

      Attachments

        Activity

          People

            Unassigned Unassigned
            boxu Bo Xu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: