Immutant provides a session implementation that provides automatic data sharing across nodes in a cluster.
You can have more than 1 web-app deployed in the same container. Each web app having it's own ring handler and context path
Define context in the project.clj:
(defproject someapp "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.4.0"]]
:immutant {:init someapp.core/start
:context-path "/foo"})
Sub context in init.clj:
(web/start "/" ring-handler)
(web/start "/echo" echo-ring-handler)
Immutant provide session replicated accross cluster node using the ring session middleware.
(ns my.ns
(:require [ring.middleware.session :as ring-session]
[immutant.web :as web]
[immutant.web.session :as immutant-session]))
(web/start
(ring-session/wrap-session
my-handler
{:store (immutant-session/servlet-store)}))
It doesn't work because you can have several webapp deployed in the same container and not all in root. So you can use an immutant utility:
(require '[immutant.util :as util])
(noir.server/load-views (util/app-relative "src/my_project_name/views"))
Same issue as your application isn't in under root. (immutant.web/wrap-resource app "public")
Jobs in Immutant are simply functions that execute on a recurring schedule. They fire asynchronously, outside of the thread where they are defined, and fire in the same runtime as the rest of the application, so have access to any shared state.
(ns my.ns
(:require [immutant.jobs :as jobs]))
(jobs/schedule "my-job-name" "*/5 * * * * ?"
#(println "I was called!")
:singleton false)
Each job scheduled gets its own mbean under the immutant.jobs namespace. This mbean can be used to stop, start, and reschedule the job.
Messaging solutions are used to achieve loosely-coupled, asynchronous systems. Uses HornetQ message borker that comes with Jboss 7.