Can someone help me understand ring's async handlers (specifically, with Jetty)

This page summarizes the projects mentioned and recommended in the original post on /r/Clojure

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • ring

    Clojure HTTP server abstraction

  • I was expecting something that (for example) spawned a future to run handler within and used the response of that future to write the servlet response, but from https://github.com/ring-clojure/ring/blob/1.6/ring-jetty-adapter/src/ring/adapter/jetty.clj#L29-L41 it looks like any work we do in handler to get the data and build the response-map will just block the servlet thread.

  • ketu

    A clojure kafka client with core.async integration.

  • Designating a single thread to act as a consumer would work, but it's probably easier to use a library like ketu, which is an async Clojure client for Kafka.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Jetty

    Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more

  • I've now got this working, sort of, so thank you for that! The sort of is because I'm getting the response I expected, but I'm also getting an exception from Jetty for every request. I've followed your pattern as given above, and when I curl the server I get the expected data back. But the REPL I'm running it in for local dev also gives the error Exception in thread "async-dispatch-[0-9]+" org.eclipse.jetty.http.BadMessageException: 500: No version. Googling that leads me to https://github.com/eclipse/jetty.project/issues/650, which seems to suggest that something else is attempting to handle the message a second time, while my handler is parked for a response in the go block? If I wrap the (a/go ...) in (a/, to effectively force it to be synchronous again, the error goes away.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Clojure Ring เบื้องต้น

    4 projects | dev.to | 29 Jun 2021
  • ANN: Factorhouse/Slipway – A Clojure Companion to Jetty

    1 project | news.ycombinator.com | 20 Dec 2022
  • ANN: factorhouse/slipway - A Clojure Companion to Jetty

    2 projects | /r/Clojure | 20 Dec 2022
  • The 12-Factor App Building Methodology

    3 projects | dev.to | 2 Jul 2022
  • Non Spring users what are you using ??

    7 projects | /r/java | 2 Nov 2021