aws

Anthony Franco 2026-05-13T01:27:17.441039Z

Has anyone used Clojure yet for Lambda durable functions?

Anthony Franco 2026-05-24T00:10:44.250039Z

@software.adhoc.87 could you provide a toy example? I'm really struggling to get the DurableHandler class extended within Clojure. Did you use another approach?

Miguel Munoz 2026-05-13T02:57:06.797979Z

yes i ddi

Anthony Franco 2026-05-13T02:58:21.351489Z

Direct interop with the Java SDK? How'd you like it? I'm thinking of ditching Step Functions and all of the extra Terraform and ASL

Miguel Munoz 2026-05-13T03:01:02.352699Z

I used direct interop with the Java SDK. Honestly worked better than I expected Clojure sits pretty naturally on top of it once you wrap a few rough edges. The big win for me was simplifying orchestration logic and avoiding the Step Functions + ASL + Terraform sprawl You still need to think carefully about determinism/replay behavior, but after that it felt pretty ergonomic

❤️ 2
2026-05-13T20:39:57.273569Z

Does aws-api have any request timeout by default? Looking through the relevant code and discussions, it seems like cognitect.http supports request timeouts but aws-api doesn't set request timeouts, and there's no way to set request timeouts without providing a custom http client. Is that correct?

👀 1
jumar 2026-05-17T15:21:27.942009Z

Hmm, interesting. But that can leave the client/socket hang indefinitely, can't it?

2026-05-15T14:14:50.614099Z

@jumar Thanks! The approach I settled on btw is to just handle this in userspace - deref a future w/ a timeout or in core.async world use a timeout channel.

jumar 2026-05-14T10:21:37.625149Z

At least when I needed it I ended up creating a custom http client. https://github.com/cognitect-labs/aws-api/issues/41 This is what it looks like at the moment

(defn- create-http-client
  "Creates an http client to be used by aws api instead of their default/shared http client.
  The main reason for this is to be able to customize timeouts - see also .
  Previously we used an instance of `cognitect.http-client` but that uses old jetty-client version which has a CVE (and unnecessary dependencies).
  The new way is to use a pure java implementation as in `cognitect.aws.http.java`.
  Instead of directly calling `cognitect.aws.http.java/create` we make a copy of that function
  to be able to customize 'connect timeout' and not only 'socket timeout')
  "
  [{:keys [conn-timeout request-timeout] :as _options}]
  ;; Copy `cognitect.aws.http.java/http-client` and adjust the connection timeout
  (let [client (-> (HttpClient/newBuilder)
                   (.connectTimeout (Duration/ofMillis conn-timeout))
                   (.followRedirects HttpClient$Redirect/NEVER)
                   (.build))]
    (reify aws-http/HttpClient
      (-submit [_ request channel]
        (java-http-client/submit client
                                 ;; set custom socket timeout (see `cognitect.aws.http.java/request->java-net-http-request`)
                                 (assoc request :timeout-msec request-timeout)
                                 channel))
      (-stop [_]
        (java-http-client/stop client)))))