Fork me on GitHub
#clojure
<
2017-09-18
>
noisesmith00:09:18

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

noisesmith00:09:54

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

Oliver George00:09:58

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

Oliver George00:09:20

https://commons.apache.org/proper/commons-daemon/procrun.html Procrun is a set of applications that allow Windows users to wrap (mostly) Java applications (e.g. Tomcat) as a Windows service.

Oliver George02:09:59

winsw seems really nice

didibus02:09:40

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.

Oliver George03:09:14

For linux I've used supervisord but there's plenty of options I think. http://supervisord.org/

schmee06:09:31

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

val_waeselynck06:09:00

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

stijn06:09:05

aleph for the same reason 🙂

val_waeselynck13:09:12

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

metametadata11:09:17

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

Ertugrul Cetin06:09:46

Does anyone know what might cause Datomic to delete databases?: https://stackoverflow.com/questions/46269961/datomic-deletes-databases

tbaldridge18:09:23

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?

Ertugrul Cetin19:09:02

@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))))

binora07:09:16

which kafka clojure library do you guys use ?

cddr07:09:47

I made ksml if you're into kafka streams. Still a bit alpha but more fun than the java interop https://github.com/cddr/ksml

binora07:09:52

@cddr hey i'm actually looking for kafka clients in clj. i went through these repos : 1. https://github.com/pingles/clj-kafka 2. https://github.com/pyr/kinsky 3. https://github.com/ymilky/franzy but they seem to be outdated. What library do you use ?

cddr07:09:42

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.

yonatanel07:09:06

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

cddr07:09:35

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

acron12:09:38

Used franzy quite a lot, no complaints

acron12:09:01

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

tolitius14:09:34

@binora: add https://github.com/weftio/gregor to your list. it's pretty minimal and upto date (this is an upto date fork: https://github.com/ccann/gregor due to https://github.com/weftio/gregor/issues/17)

ghadi16:09:05

wow there are a lot of Kafka libraries

cddr16:09:58

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

cddr16:09:14

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

ljosa17:09:59

@binora: we still use clj-kafka, sometimes with https://github.com/yieldbot/torna on top.

bfabry17:09:24

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

ghadi17:09:34

I smell a beta release brewing.

seancorfield17:09:51

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

seancorfield17:09:52

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.

ghadi17:09:36

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

seancorfield17:09:19

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.

seancorfield17:09:52

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

ghadi17:09:02

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?)

noisesmith17:09:34

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

noisesmith17:09:07

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”?)

noisesmith17:09:56

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.

noisesmith18:09:14

clojure compiles any time you like

noisesmith18:09:22

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.

noisesmith18:09:56

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

noisesmith18:09:32

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

noisesmith18:09:39

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.

noisesmith18:09:20

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)

noisesmith18:09:52

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

noisesmith18:09:06

io/resource works well and abstracts packaging / deployment nicely

rcustodio18:09:01

any plans to add to clojure?

Alex Miller (Clojure team)18:09:18

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

rcustodio18:09:53

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

Alex Miller (Clojure team)19:09:12

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

Alex Miller (Clojure team)19:09:32

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

rcustodio19:09:08

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

bronsa19:09:56

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

rcustodio19:09:46

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

bronsa19:09:39

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)

rcustodio19:09:33

I see, thanks

seancorfield20:09:23

@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 http://clojure.java.io/resource)?

adamfrey21:09:07

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

Garrett Hopper21:09:28

Good call :thumbsup: