[daisy] sharing one openjms instance between multiple repositories

Bruno Dumon bruno at outerthought.org
Thu Mar 30 02:40:53 CST 2006


just posting the same with a new subject to make it easier to find back
in the archives.

-------- Forwarded Message --------
From: Bruno Dumon <bruno at outerthought.org>
Reply-To: Daisy: open source CMS - general mailinglist
<daisy at lists.cocoondev.org>
To: Daisy: open source CMS - general mailinglist
<daisy at lists.cocoondev.org>
Subject: Re: [daisy] no site-name in url
Date: Thu, 30 Mar 2006 10:29:04 +0200

On Thu, 2006-03-30 at 09:10 +0200, Patrick Ahles wrote:
> On 3/29/06, Andreas Deininger <adeininger at googlemail.com> wrote:
>         
>         I agree. In many cases, Running multiple repositories seems to
>         be the
>         appropriate solution
>         to me. Maybe, beneath sharing the cocoon instance, could one
>         reuse an
>         existing openjms server, too? I just tried to setup a second
>         daisy 
>         installation on a host which already has a daisy installation
>         running,
>         and I failed starting up a second openjms server:
>         
>         $./startup.sh
>         Using OPENJMS_HOME: /xxx/daisy/openjms
>         Using JAVA_HOME:    /usr/java/jdk 
>         OpenJMS 0.7.6.1
>         The OpenJMS Group. (C) 1999-2004. All rights reserved.
>         http://openjms.sourceforge.net
>         org.exolab.jms.server.FailedToCreateServerException :
>         org.exolab.core.service.ServiceException: Failed to create
>         RmiRegistryService java.rmi.server.ExportException: Port
>         already in
>         use: 1099; nested exception is:
>                 java.net.BindException: Address already in use 
>                 at
>         org.exolab.core.util.RmiRegistryService.<init>(RmiRegistryService.java:129)
>                 at
>         org.exolab.core.util.RmiRegistryService.<init>(RmiRegistryService.java:110)
>                 at org.exolab.jms.server.JmsServer.createRegistry
>         (JmsServer.java:379)
>                 at
>         org.exolab.jms.server.JmsServer.init(JmsServer.java:179)
>                 at
>         org.exolab.jms.server.JmsServer.main(JmsServer.java:229)
>         
>         What would be the appropriate way to get two daisy
>         repositories 
>         running on the same machine?
> 
> check http://lists.cocoondev.org/pipermail/daisy/2005-July/001666.html
> where Olivier Lange describes what he has done. 
>  

That's basically it, I once had to write out how to do this so I can as
well share it:

where you now have this in the openjms.xml :

  <AdministeredDestinations>
    <AdministeredTopic name="daisy">
      <Subscriber name="fullTextIndexer"/>
      <Subscriber name="emailNotifier"/>
    </AdministeredTopic>
    <AdministeredQueue name="fullTextIndexerJobs"/>
  </AdministeredDestinations>

it needs to be doubled to e.g.:

  <AdministeredDestinations>
    <AdministeredTopic name="daisy_1">
      <Subscriber name="fullTextIndexer_1"/>
      <Subscriber name="emailNotifier_1"/>
    </AdministeredTopic>
    <AdministeredQueue name="fullTextIndexerJobs_1"/>

    <AdministeredTopic name="daisy_2">
      <Subscriber name="fullTextIndexer_2"/>
      <Subscriber name="emailNotifier_2"/>
    </AdministeredTopic>
    <AdministeredQueue name="fullTextIndexerJobs_2"/>
  </AdministeredDestinations>


For each Cocoon (Daisy Wiki): in the cocoon.xconf inside the
configuration for this component:

<component class="org.outerj.daisy.repository.clientimpl.RemoteRepositoryManager"

add an extra configuration element jmsTopic:

<jmsTopic>daisy_1</jmsTopic>

and likewise for the second wiki.

Then in the myconfig.xml of each repository server, add:

  <target path="/daisy/repository/eventdispatcher">
    <configuration>
      <jmsTopic>daisy_1</jmsTopic>
    </configuration>
  </target>

  <target path="/daisy/repository/fulltextindexupdater">
    <configuration>
        <jmsTopic>daisy_1</jmsTopic>
        <jmsSubscriptionName>fullTextIndexer_1</jmsSubscriptionName>
        <jmsQueue>fullTextIndexerJobs_1</jmsQueue>
    </configuration>
  </target>

  <target path="/daisy/extensions/emailnotifier/emailnotifier">
    <configuration>
          <jmsTopic>daisy_1</jmsTopic>
          <jmsSubscriptionName>emailNotifier_1</jmsSubscriptionName>
    </configuration>
  </target>

If there would already be a target element with the same path attribute,
you need to add the configuration elements to the existing one (which is
normally the case for fulltextindexupdater and emailnotifier).

It's important to do this all correctly, since otherwise you might wind
up with events from one repository going to the other...

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno at outerthought.org                          bruno at apache.org



More information about the daisy mailing list