For those who want to upgrade the Electric Clojure v3 starter to Ring 1.15.3 (deps.edn: ring/ring {:mvn/version "1.15.3"}), Jetty 12 now supports built-in websocket config (note :ws-idle-timeout etc.), e.g. in file src-dev/dev.cljc:
#?(:clj
(defn start-server! [port]
(ring/run-jetty
(-> (fn [ring-request] (-> (ring-response/resource-response "index.dev.html" {:root "public/myproject"}) (ring-response/content-type "text/html")))
(wrap-resource "public/myproject")
(wrap-content-type)
(electric-ring/wrap-electric-websocket (fn [ring-request] (myproject.main/electric-boot ring-request)))
(wrap-demo-authentication)
; note: no rejection here for stale Electric client
(cookies/wrap-cookies) ; order?
(wrap-params))
; relevant config below:
{:host "localhost"
:port port
:join? false
:ws-idle-timeout (* 60 1000) ; 60 seconds in milliseconds
:ws-max-binary-size (* 100 1024 1024) ; 100M
:ws-max-text-size (* 100 1024 1024)})))I ran into this today. In ring 1.15.3 the approach in the starter app and datomic browser will throw java.lang.ClassNotFoundException for org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer and the fix is to replace usage of the configurator with the keyword options to run-jetty
ok, we have a new release coming soon, i will make a note to consider upgrading ring
I am trying to understand what this is "Jetty 12 now supports built-in websocket config" and what it has to do with Ring 1.15.3
I see here https://github.com/ring-clojure/ring/blob/master/CHANGELOG.md RIng 1.14 "Added Jetty option :ws-idle-timeout for setting idle timeout (#513)"
I see Ring 1.14 is the first version supporting jetty 12
I see electric-starter-app uses ring 1.11 https://github.com/hyperfiddle/electric3-starter-app/blob/main/deps.edn
Ring 1.14 was launched in April 2025, here is the previous thread https://clojurians.slack.com/archives/C7Q9GSHFV/p1744227345619169
I see we have an internal ticket to upgrade to Jetty 12 which we have not done yet. I recall that the reason is because enterprise users mostly hadn't upgraded and we can't drop support for older versions
I see this comment from our jetty 12 discovery work: β’ ;; ring/ring {:mvn/version "1.14.1"} ; jetty 12, works but message payload size tunning API has changed, we need to upgrade it.
Ok, I think what you're telling me is that you upgraded to Ring 1.14, and therefore you had to update the "ws message payload size tuning", and the config map you provided shows us how you did that
Just for full context and XY problem etc, what problem were you facing that made you do this? Was this because security audits flag Jetty versions prior to 12 as EOL? Or did you need Jetty 12 features?
I added dep https://github.com/latacora/mcp-sdk to a project, which bumps Ring, but the electric starter template is not compatible with that version and I donβt know how to deal with multiple versions of libraries in the same project. I regard that as a deficiency in both Java and Clojure.
you can force it to downgrade, chatgpt knows how
https://clojurians.slack.com/archives/C7Q9GSHFV/p1770287316819369