[prev in list] [next in list] [prev in thread] [next in thread] 

List:       james-user
Subject:    Re: Custom locking for James cluster
From:       Mike Heath <mike () cycletime ! com>
Date:       2004-07-30 17:09:38
Message-ID: 1091207377.4654.22.camel () tempest ! swamp
[Download RAW message or body]

Thanks for you suggestion Danny.  Including our classes in james.jar
(and then putting our new james.jar back into james.sar) solved our
class loading problems.

Our distributed locking mechanism is now working with James and our
initial tests show that it's working fine.  We are able to use at least
3 instances of James against a single DB backend.  We haven't seen any
lost or duplicated E-mails.  We plan to do more robust testing in the
near future.

My question now is, is it possible for James to use multiple spools?  We
would like to have one instance of James use its own spool for
forwarding incoming E-mails.  We would like that same instance of James
to also participate in our cluster and send out E-mails in the shared
spool.  Is this possible or would it be easier to just to use a second
instance of James on the same host?

As a post-script, if anyone is interested in using/testing our
distributed locking mechanism for a James cluster, I have received
permission from my employer, Avalon Digital Marketing Systems, Inc., to
release the code as open source.  We have licensed our code under the
terms of the LGPL.  The source code will be hosted at Source Forge under
the "james-ha" project.  The project currently exists but the source
code has not yet been uploaded.  I hope to get the code uploaded and
ready for others to use over the weekend and have a beta release
available for download and testing early next week.

-Mike

On Mon, 2004-07-26 at 02:01, Danny Angus wrote:
> Try rebuilding James.sar with your classes in james.jar, it puts them
> "deeper" in the class loader, sar-inf/lib is really only for mailets and
> their dependancies, not for James classes, the fact that it works at all is
> probably only due to current laxity in classloader seperation between
> installed mailets and James (as a container) itself
> 
> ---
> Danny Angus
> Senior Analyst Programmer
> Front Office
> 4W
> 3257
> 
> 
> 
> > ---------+---------------------------->
> > > Mike Heath       |
> > > <mheath@avaloninc|
> > > .com>            |
> > > > 
> > > 23/07/2004 09:18 |
> > > PM               |
> > > Please respond to|
> > > "James Users     |
> > > List"            |
> > > > 
> > ---------+---------------------------->
> > ---------------------------------------------------------------------------------------------------------------|
> > 
> > > 
> > To:       server-user@james.apache.org                                            \
> > |
> > cc:                                                                               \
> > |
> > Subject:  Custom locking for James cluster                                        \
> >                 |
> > ---------------------------------------------------------------------------------------------------------------|
> > 
> 
> 
> 
> 
> After looking through the James source (specifically the JDBC pool
> code), it seams to me that James could be clustered (multiple James
> instances using the same database backend) by using a distributed lock
> instead of org.apache.james.util.Lock and then extending
> org.apache.james.mailrepository.JDBCMailRepository and overriding lock()
> and unlock() to use the distributed lock.
> 
> To test my theory, I wrote a distributed lock (using JGroups) with the
> same functionality as the James lock.  I've extended
> org.apache.james.mailrepository.JDBCMailRepository and
> org.apache.james.mailrepository.JDBCSpoolRepository and I overrode their
> lock() and unlock() methods to use the distributed lock.  I put my
> classes in the james.jar in apps/james/SAR-INF/lib.  I've updated the
> James config file telling it to use my classes.
> 
> Now, when I start James I get a "java.lang.NoClassDefFoundError:
> org/apache/james/mailrepository/JDBCSpoolRepository" exception.  This
> class is still in james.jar.
> 
> I'm flustered as to what might be causing this.  If I only change the
> config file and tell it to point to the James default classes,
> everything works fine.  Any ideas?
> 
> Secondly (and probably more importantly), should this approach work?
> We're building an E-mail product and are very interested in being able
> to easily scale our E-mail output as well as have automatic fail-over.
> James gives us the programmability that we need but we are concerned
> about it's lack of support for multiple hosts running against the same
> database backend which is ultimately the problem we are trying to solve.
> 
> -Mike
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
> 
> 
> 
> 
> 
> 
> ***************************************************************************
> The information in this e-mail is confidential and for use by the addressee(s) \
> only. If you are not the intended recipient (or responsible for delivery of the \
> message to the intended recipient) please notify us immediately on 0141 306 2050 \
> and delete the message from your computer. You may not copy or forward it or use or \
> disclose its contents to any other person. As Internet communications are capable \
> of data corruption Student Loans Company Limited does not accept any  \
> responsibility for changes made to this message after it was sent. For this reason \
> it may be inappropriate to rely on advice or opinions contained in an e-mail \
> without obtaining written confirmation of it. Neither Student Loans Company Limited \
> or the sender accepts any liability or responsibility for viruses as it is your \
> responsibility to scan attachments (if any). Opinions and views expressed in this \
> e-mail are those of the sender and may not reflect the opinions and views of The \
> Student Loans Company Limited. 
> This footnote also confirms that this email message has been swept for the presence \
> of computer viruses. 
> **************************************************************************
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic