Return-Path: Delivered-To: apmail-geronimo-activemq-dev-archive@www.apache.org Received: (qmail 97376 invoked from network); 28 Aug 2006 18:53:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Aug 2006 18:53:45 -0000 Received: (qmail 84903 invoked by uid 500); 28 Aug 2006 18:53:45 -0000 Delivered-To: apmail-geronimo-activemq-dev-archive@geronimo.apache.org Received: (qmail 84786 invoked by uid 500); 28 Aug 2006 18:53:45 -0000 Mailing-List: contact activemq-dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-dev@geronimo.apache.org Received: (qmail 84770 invoked by uid 99); 28 Aug 2006 18:53:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Aug 2006 11:53:45 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Aug 2006 11:53:44 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AD04F7142D5 for ; Mon, 28 Aug 2006 18:50:23 +0000 (GMT) Message-ID: <893963.1156791023705.JavaMail.jira@brutus> Date: Mon, 28 Aug 2006 11:50:23 -0700 (PDT) From: "Maxim Fateev (JIRA)" To: activemq-dev@geronimo.apache.org Subject: [jira] Commented: (AMQ-877) Patch: refactoring to allow alternative (using different storage interface) Destinations implementations. In-Reply-To: <9308855.1155324623114.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ https://issues.apache.org/activemq/browse/AMQ-877?page=comments#action_36869 ] Maxim Fateev commented on AMQ-877: ---------------------------------- It looks like unit tests of HEAD are broken without my patch. I'm looking into fixing them. > Patch: refactoring to allow alternative (using different storage interface) Destinations implementations. > --------------------------------------------------------------------------------------------------------- > > Key: AMQ-877 > URL: https://issues.apache.org/activemq/browse/AMQ-877 > Project: ActiveMQ > Issue Type: Improvement > Components: Broker > Affects Versions: 4.x > Reporter: Maxim Fateev > Assigned To: james strachan > Fix For: 4.1 > > Attachments: destinationFactoryActiveMQPatch.txt > > > We were looking at alternate message persistence mechanisms that can co-exist in current ActiveMQ code base and we are thinking of a mechanism that is somewhat incompatible with the current MessageStore and PersistenceAdapter APIs. Unfortunately, the current ActiveMQ broker doesn't allow for such a change as the PersistenceAdapter and MessageStore interfaces are referenced directly by the RegionBroker and by both the Queue and Topic region implementations. Therefore, we are proposing a relatively small backwards compatible refactoring of the broker code that would eliminate all dependencies on the PersistenceAdapter and MessageStore interfaces from those classes that do not use them directly. This refactoring would also allow creation of a custom Destination implementation that may use an alternative persistence mechanism on a destination by destination basis (which is exactly what we need to do). > The main idea behind the refactoring is to replace many references to PersistenceAdapter with a new interface: DestinationFactory: > public abstract class DestinationFactory { > abstract public Destination createDestination(ConnectionContext context, ActiveMQDestination destination, DestinationStatistics destinationStatistics) throws Exception; > abstract public Set getDestinations(); > abstract public SubscriptionInfo[] getAllDurableSubscriptions(ActiveMQTopic topic) throws IOException; > abstract public long getLastMessageBrokerSequenceId() throws IOException; > abstract public void setRegionBroker(RegionBroker regionBroker); > } > Note that DestinationFactory doesn't mandate any specific persistence mechanism. The classes that would reference it instead of PersistenceAdapter are: RegionBroker, AbstractRegion, QueueRegion, and TopicRegion. Also, the AbstractRegion.createDestination method would be changed from abstract to an implementation that uses DestinationFactory to create a destination. > BrokerService could be changed to use DestinationFactory if one is provided. If none is provided, it will create a DestinationFactory implementation that instantiates Queue and Topic using PersistenceAdapter as it does currently. Hence, full backwards compatibility will be maintained. > Patch is attached. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira