You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Antoine DUPRAT <ad...@linagora.com> on 2015/11/04 09:58:26 UTC
James & Guice
Hi all,
Integrating Guice injection inside James is an old requested feature.
https://issues.apache.org/jira/browse/JAMES-1479
We are glad to provide you a new java project inside James (james-project).
As you may know, here is a list of the main advantages of Guice between
Spring:
- you only bring what you need in Guice (no extra jars)
- starting the application is faster with Guice
- you are able to launch James in your favorite IDE (faster debugging
session)
To achieve that, we have to chose the backends that will be deployed
when binding the interfaces.
Our choices go to Cassandra for the mailbox backend and ElasticSeach for
the search backend.
This job is done in Guice modules, each responsible for a simple
category, for example:
- CassandraMailboxModule
- IMAPServerModule
- SMTPServerModule
- ...
By this way, new backend modules can easily be developped, and you may
reuse some common modules.
If you wish to try it, you just have to use the following commands
inside james-project:
/$ //JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 mvn clean install//
//$ /usr/lib/jvm/java-8-openjdk-amd64/bin/java -jar
-Dworking.directory=WORKING_DIRECTORY/
server/container/cassandra-guice/target/mes-server-cassandra-guice-3.0.0-beta5-SNAPSHOT.jar//
/
Where WORKING_DIRECTORY folder contains the classical folders:
- conf/
- users/
- var/
For the ease of the test, i attach to this email the Cassandra and
ElasticSearch configuration files, then you will have to change the IPs in:
- conf/cassandra.properties
- conf/elasticsearch.properties
You may want to run Cassandra & ElasticSearch in docker, here are the
commands to start them and retrieve their IPs:
/$ docker run -d --name=cassandra cassandra//
//$ docker inspect cassandra | grep IPAddress//
//$ docker run -d --name=elasticsearch elasticsearch:1.5.2//
//$ docker inspect elasticsearch | grep IPAddress//
/
Greetings,
--
Antoine