weavejester / compojure

A concise routing library for Ring/Clojure
Eclipse Public License 1.0
4.08k stars 259 forks source link

Embed a Java servlet in a Ring/Compojure app #176

Closed MichaelBlume closed 6 years ago

MichaelBlume commented 6 years ago

Sometimes a dependency provides an out-of-the-box Servlet object. A good example is the HystrixMetricsStreamServlet which exposes metrics to an external hystrix dashboard. Is there a good one-size-fits-all way to embed such a Servlet in a Compojure/Ring app?

weavejester commented 6 years ago

There might be a library available to do that, but I'm not aware of one off hand. Compojure is just a routing library, so this is a little beyond its scope.

jiacai2050 commented 6 years ago

@MichaelBlume I think this is what you need

MichaelBlume commented 6 years ago

@jiacai2050 I tried that, when I wired it into my project I got an error No implementation of method: :write-body-to-stream of protocol: #'ring.core.protocols/StreamableResponseBody found for class: lamina.core.channel.Channel -- I assume some dependency has changed since it worked

jiacai2050 commented 6 years ago

@MichaelBlume Try this adapter