Details
-
Wish
-
Status: Resolved
-
Major
-
Resolution: Not A Problem
-
5.9.0
-
None
-
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[]
—
> 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())
—
> 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)
> //else return null;
> } catch (IOException 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)
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);