Fork me on GitHub

sadly our app is a closed source software as a service, but templates like luminus should be a start


they use mount which I'm not as fond of, but the basic ideas are there and luminus is very useful as a big picture starting point which does a lot of things the right way for a web app


Can anyone recommend a good way to deploy a clojure service on a Windows server? A quick google uncovered procrun and winsw as candidates

olivergeorge00:09:20 Procrun is a set of applications that allow Windows users to wrap (mostly) Java applications (e.g. Tomcat) as a Windows service.


winsw seems really nice


The manifesto for it says: >As the name implies, this is for Windows only. Unix systems have their own conventions for daemons, so a good behaving Unix daemon should just be using launchd/upstart/SMF/etc, instead of custom service wrapper. But I've been looking for a linux daemon which manages a process lifetime. Something that can catch all application crashes, log it, and restart the application with an appropriate context.


For linux I've used supervisord but there's plenty of options I think.


general question: which Clojure HTTP client do you prefer and why?


Http-kit, for its non-blocking IO and data-driven interface


aleph for the same reason 🙂


oh, I never knew that aleph also shipped a client, worth checking out!


cljs-ajax. so that I can use the same API in frontend and backend


Does anyone know what might cause Datomic to delete databases?:


I seriously doubt it does, it's most likely some other issue. Can you post the code somewhere were we can take a look at it?


@U07TDTQNL here is the code: (defn establish-conn [] (try (d/create-database (conf/get :db-uri)) (reset! conn (d/connect (conf/get :db-uri))) (catch Throwable t (log/error "Could not establish db conn." t)))) (defn create-db! [] (establish-conn) @(d/transact @conn (collect-schema))) ;;it's used in global exception handler (defn fix-if-conn-ex [ex] (let [err-msg (.getMessage ex)] (when (any? #(str/includes? err-msg %) [":db.error/transactor-unavailable" ":db.error/connection-released"]) (db/establish-conn))))


which kafka clojure library do you guys use ?


I made ksml if you're into kafka streams. Still a bit alpha but more fun than the java interop


@cddr hey i'm actually looking for kafka clients in clj. i went through these repos : 1. 2. 3. but they seem to be outdated. What library do you use ?


I don't really use Kafka without Kafka streams. But ksml is a clojure Kafka client. It lets you define a data flow topology in data and then compiles it down to the underlying java interop.


I just use the kafka java api, polling loop inside a manifold future (thread). Not sure how great that is though.


Yeah you can go a long way with Java interop. Kafka itself is moving very fast so wrappers are always out of date unless the maintainer has lots of time to keep on top of the changes


Used franzy quite a lot, no complaints


clj-kafka very old now (<= Kafka 0.8)


@binora: add to your list. it's pretty minimal and upto date (this is an upto date fork: due to


wow there are a lot of Kafka libraries


Kafka 0.8 was current when I started my kafka journey a couple of years ago.


I guess 2 years is a long time. Doesn't feel like it though


@binora: we still use clj-kafka, sometimes with on top.


we just use "org.apache.kafka/kafka-clients" in about 4 different clojure services


I smell a beta release brewing.


With Conj just around the corner, I'm not surprised...


I guess we'll put that in production next week 🙂 We're on Alpha 20 in production right now and already locked for this week's production release.


It's been pretty good for a while, but when's the last time you were bitten by an alpha/beta @seancorfield ?


I honestly can't remember. I remember we dodged a bullet with 1.5.0 -- we were on the last pre-release before the memory leak was introduced and the timing of 1.5.0 was such that we went straight to 1.5.1 in our next build.


Mind you, we have a lot more Clojure in production now than we did back then.


yeah that wasn't a fun release

Garrett Hopper17:09:44

How can I have a macro read in a file next to the source file? (Perhaps something like ns, but with the current directory of the file or something like &env or &form?)


depends, do you want code that works when run from a jar?


because if yes (and that’s the usual answer) things like “current directory” don’t really work (perhaps you can generalize to “path to the current resource”?)


but you really do have to avoid all concepts of “file” or “directory” to make code that packages and deploys correctly without weird hoop jumping

Garrett Hopper18:09:04

No, it's just a compile time thing.


clojure compiles any time you like


the clojure compiler runs on startup

Garrett Hopper18:09:50

The issue is I don't want to give the macro a full path to the file. I want to colocate these files next to the source files.


that is, if you deploy a library, it compiles when the jvm starts (with few and rare exceptions)


it would be easy enough to construct the path to a resource out of the current namespace


since namespaces map to resource paths

Garrett Hopper18:09:16

Yeah, I suppose I could do that. file also gets me close. Was just wondering if this was standard.


if you do it that way, you can ignore the questions of files and directories - use to find the thing (it won’t matter if it’s a file, a url, a thing inside a jar - it will just work)


@ghopper the standard thing is to only use File and directory based stuff for things that will not be packaged with your code


io/resource works well and abstracts packaging / deployment nicely


any plans to add to clojure?


you’ve got all those libs ^^ - use those!


I know.. but core.match still in alpha, no plans to finish until 1.9 realease?


I think @dnolen would be happy to have some help with core.match as he has many things on his plate


I don’t think there is anything preventing you from using it now


I will try, but I'm still new in clojure, thanks @alexmiller for the news


I can't speak for @dnolen but core.match is really not alpha at all -- the alpha modifier for the 0.3.0 release might refer to some experimental feature in that specific version but the basic engine is very stable and usable in production


thanks @bronsa, that is really helpful, guards helps a lot in functional development


meh, I wouldn't say they do that much in clojure, we don't do extensive pattern matching like haskell do for example. When people use core.match it's usually for some internal bits, not as a way of doing their general library development (exceptions apply)


I see, thanks


@rcustodio That clojure-guards post just looks like a complicated solution instead of using the built-in cond expression...

Garrett Hopper20:09:09

So I'm attempting to build a system to colocate css files with source code. I'm using boot-reload to reload my clojure files. Is there a way to make boot-reload reload clojure files that depend on css files (using


@ghopper you might want to ask in the #boot channel

Garrett Hopper21:09:28

Good call :thumbsup: