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
# Configuration file for cassandra mailbox

cassandra.ip=172.17.0.1
cassandra.port=9042
cassandra.keyspace=apache_james
cassandra.replication.factor=1
# Configuration file for ElasticSearch

elasticsearch.masterHost=172.17.0.2
elasticsearch.port=9300
elasticsearch.nb.shards=1
elasticsearch.nb.replica=1
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to