From 8573072a6f777c43b3b09a2afbb6c0d1348bc392 Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Thu, 29 May 2008 17:01:55 +0000 Subject: [PATCH] Fixed PublishOnTopicConsumerMessageUsingActivemqXMLTest case that started failing due to the recently added chagne to the journal persistence adapter which did a: this.usageManager.getMemoryUsage().addUsageListener(this); on start. Basically we now don't start the persistence layer until the broker is started (was happening when the broker was created). git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@661402 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/activemq/broker/BrokerService.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java index f67c5560af..684dfb433b 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/BrokerService.java @@ -447,18 +447,23 @@ public class BrokerService implements Service { BrokerRegistry.getInstance().bind(getBrokerName(), this); - startDestinations(); - - addShutdownHook(); + LOG.info("Using Persistence Adapter: " + getPersistenceAdapter()); + getPersistenceAdapter().setUsageManager(getProducerSystemUsage()); + getPersistenceAdapter().setBrokerName(getBrokerName()); if (deleteAllMessagesOnStartup) { deleteAllMessages(); } + getPersistenceAdapter().start(); + + startDestinations(); + + addShutdownHook(); if (isUseJmx()) { getManagementContext().start(); } - + getBroker().start(); // see if there is a MasterBroker service and if so, configure @@ -1596,12 +1601,10 @@ public class BrokerService implements Service { protected Broker createRegionBroker() throws Exception { // we must start the persistence adaptor before we can create the region // broker - getPersistenceAdapter().setUsageManager(getProducerSystemUsage()); - getPersistenceAdapter().setBrokerName(getBrokerName()); if (this.deleteAllMessagesOnStartup) { getPersistenceAdapter().deleteAllMessages(); } - getPersistenceAdapter().start(); +// getPersistenceAdapter().start(); if (destinationInterceptors == null) { destinationInterceptors = createDefaultDestinationInterceptor();