Fork me on GitHub
Mario C.01:11:29

Hopefully this question is in the right channel but what is WildFly? From their site > WildFly is a flexible, lightweight, managed application runtime that helps you build amazing applications. Which I am not entirely sure what that is. Do I need it to run my Clojure application?


wildfly is an app server which is sort of like a framework

Mario C.01:11:15

So Wildfly, Jetty, Undertow, TomCat, Apache, Nginx all more or less do the same thing?

Mario C.01:11:51

A person writes a API in Clojure that then becomes a Java application which runs on the JVM which runs along side (Wildfly, Jetty, Undertow...) which runs on a machine?


the Wildfly server runs clojure.main to run your code, more likely


I wouldn't get too hung up on the taxonomy of the whatever

Mario C.01:11:33

I like to be able to see the connection of these things


the problem is a lot of those words you used there are overloaded


app servers are basically generic applications running on top of the jvm


they don't run a long side it


they provide a kind of standard environment for your application to run in


I haven't seen app servers themselves used a lot with clojure, but older clojure code bases often end up looking kind of like an app server


a lot of app servers come with a webserver as part of the environment, and sometimes you can use that webserver without the appserver as well (jetty, undertow)


I think undertow might actually be the webserver wildfly uses


I think the most common way to run Clojure web applications is with the embedded Jetty server (followed by http-kit and Aleph perhaps?)... Since the Jetty adapter has been bundled with Ring for a long time. I gather Immutant is now available as an embedded server library for Ring as well...


Immutant will work just fine without an application server.


Not just the HTTP server, but the caching, scheduling, and transactions libraries as well.


Yeah, it was only the 1.x version of Immutant that required a JBoss app server in order to run. I remember trying the library version a while back

Mario C.01:11:10

Got it. Its just starts getting difficult to understand when I see terms like web server/app server used interchangeably. Then seeing that an app is deployed to Wildfly using JBoss and i start to get scambled


(Immutant uses Undertow?)


Undertow, Infinispan, HornetQ, and something else for transactions

Mario C.01:11:04



@mario.cordova.862 In the Java world, you'll hear folks talk about Servlet containers, app servers, web servers... but in the Clojure world we can ignore most of that.


You can create a WAR file for container-based deployment but you don't need to.


As someone who was wondering exactly what Mario was wondering very recently, I wish there was some guide on what benefits an application server provides


All Immutant docs say is that you can use it with Wildfly if you want


Doesn't go into the why


literally what you just linked.


I think people use eg. Docker with java inside to get most of the benefits


monitoring, automatic restarts or recovery of some sort, log aggregation, etc.


with Docker it's the same tooling / setup you used with Ruby or whatever (a common case)


You can also run Wildfly inside docker :thinking_face:


not sure if there's a practical reason to do so...


right - but if you didn't have Docker or Wildfly, you would have to do some goofy things to ensure your process was running, check logs, etc.


In java-land, in the past 5 years, people have also been embedding an 'appserver' into their application instead of deploying their app to some container. See Spring Boot.


Clojure apps also embed a webserver. This is to say, there isn't much difference here.


What are options for Streaming of text. I don't want to slurp everything into memory at once. is there any way for streaming in Clojure?


Sure, check out line-seq


Is there any obvious way to one incorporate version string into clojurescript build artifacts? (leiningen & cljsbuild)


@marcin.k.chmiel One way is to use :closure-defines


@mfikes thanks. I was unclear, what I meant was to produce files named like when generating jars (i.e. artifact-$projectVersion.js)


@marcin.k.chmiel There is a new feature that will put a fingerprint in the filename (not a version, but a hash)


How about a more generic way, like running code inside project.clj?


Ok, got it. I knew it was possible, but forgot everything inside defproject is quoted. I defined version before and unquotted it in compiler options

(def version "0.1.0-SNAPSHOT")
(def output (str "resources/public/js/main-" version ".js"))
:compiler {:optimizations :advanced
                                   :output-to ~output


Hmm. Is there some clojury-thing I'm missing here... I'm surprised exists


So what I'm asking is: does ragtime offer something that flyway can't, simply because it was written in Clojure?


Hi, I'm trying to add a set of default styles on (for example) a material-ui button. In the code below, I'd like styles to be applied to the button - but I'm not sure where/when/how to apply it.

(ns ui.buttons.basic
  (:require [reagent.core :as r]
            [stylefy.core :as s]
            ["@material-ui/core/Button" :default Button]))

(def styles {:background-color "red"})
(def button (r/adapt-react-class Button))
I want to be able to (require [ui.buttons.basic :as b]) and use the button with the red background. Am I missing something obvious? I'm using shadow-cljs to have access to material-ui like that...Thanks!


Hello everyone. I am wondering if I should place [hiccup "1.0.5"] under {:dev {:dependencies or :dependencies [


when is hiccup used?


@somedude314 It depends on how you're using Hiccup -- as part of your dev workflow only, or as part of your intended (production) runtime?


I am using it with Compojure to display HTML


Not sure what that qualifies it for


if anything in your running app uses hiccup, don't put it under :dev


The :dev profile is intended for development-time tooling, not "normal" runtime.


Aha, got it. I thought it won't be needed after the compilation to uberjar. Thanks.


the question is whether any code path compiles hiccup data to html - doing that as a build step would be valid, but not how most people do things


I have a java project with some clojure code that is called from java. For testing I use an in memory h2 database. What is the correct way to test my clojure methods that call a database? My clojure code currently creates a connection pool to whatever database(s) I need to connect to on startup, and I am not sure how to test the methods? How do I connect to the h2 db? How do I setup the code so that it builds the connection pool when running in production but can connect to the h2 db when running tests?


for connecting to the DB you can use


for choosing different DBs in test and prod you most likely want to use something like Component or Mount


if you are parameterizing code over some value (for example different database connections), the best way to do that is to have functions that take that value as a parameter