Fork me on GitHub

Evening everyone! I have a question about the swagger integration. I don’t see anything about what messages are returned to the consumer of the API. For example, if I return the json below I would want to display in swagger that you’d receive a; array of maps with count and modified_date keys.

        "count": 556,
        "modified_date": "2016-09-12"
        "count": 1,
        "modified_date": "2016-09-14"


Looking at the ring-swagger stuff it looks like you can include a :schema key with a Plumatic Schema to the :responses key for a particular status code.


I was trying to get SO_REUSEPORT to work. The aim is to have zero-downtime deployment. As far as I understand, using SO_REUSEPORT, one can have two (or more) applications listening to the same port (without having a Address already in use-issue). So:

(ns ...
  (:require ...
    [aleph.http :as http]
 (let [http-server (http/start-server
                     (bidi/make-handler api)
                     (conj (::http config)
                            #(doto %
                               (.option ChannelOption/SO_BROADCAST true)
                               (.option EpollChannelOption/SO_REUSEPORT true))}))]
    (netty/wait-for-close http-server)))
Just very quick questions: did anyone try to get SO_REUSEPORT to work (with yada/aleph/netty in clojure)? Did it work? How did you do it 🙂? ( ,


@kurt-yagram: my memory of reuseport (from C sockets) was this: If I started a server too quickly after killing the old one, the kernel wouldn't have released it. But I don't remember it allowing parallel listeners. Who's response wins?


Well, I thought it would be like a kind of load balancing, but apparently, it doesn't work like that. I mean, it doesn't seem to be possible to make 2 applications listening on the same port (and the os taking care of dispatch/choosing one).


I'm implementing sse with yada. All seems to work fine, except, yada prepends data: to all messages. This would be fine, if sse message only have a data:-field, which is not the case. They also accept retry, id and event-fields. Can this be configured somewhere? I'd like to send messages like:

id: <message-id>\n
data: whatever\n\n


Hi @kurt-yagram - trying providing your own defmethod for text/event-stream, taking the existing code as a template.


That way you'll have full control. The current implementation works as a HOWTO. Yada is declarative to a point, but beyond it's programming that takes over.


allright 🙂