Bo Xu created AMQ-5069:
--------------------------
Summary: scheduled delivery did not work when persistent="false"
schedulerSupport="true"
Key: AMQ-5069
URL: https://issues.apache.org/jira/browse/AMQ-5069
Project: ActiveMQ
Issue Type: Bug
Components: Broker
Affects Versions: 5.9.0
Reporter: Bo Xu
Priority: Critical
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);
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)