Fork me on GitHub

Hi! How do I configure jetty's maxidleconnections in a service? Right now I'm doing:

(def service {:env :prod
              ;; You can bring your own non-default interceptors. Make
              ;; sure you include routing and set it up right for
              ;; dev-mode. If you do, many other keys for configuring
              ;; default interceptors will be ignored.
              ;; :http/interceptors []
              ::http/routes routes
              ;; Root for resource interceptor that is available by default.
              ::http/resource-path "/public"
              ;; Either :jetty or :tomcat (see comments in project.clj
              ;; to enable Tomcat)
              ::http/type :jetty
              ::http/port 8080})


Interesting, I tried lein clean plus deleting io.pedestal and org.clojure from my .m2 directory, and now I’m getting No matching ctor found for class io.pedestal.interceptor.helpers$on_request$fn__8950, which I’m not using anywhere in my project.


I think my next attempt is going to be lein new plus incrementally copy over source files from my previous attempt.


@manutter51 Are you using any additional libraries that might have been built against an older version of Pedestal? Try adding :pedantic? :abort to your project.clj to see if that's an issue.


I'm trying to write some Vase routes, but I can't find a full manual or reference. (I've been copying from the examples, and mostly understand what's going on, but not completely). I've looked at info about Vase, Datamic, and Datalog, and keep finding more pieces, but I can't find a doc that gives me the full picture; especially not from a Vase perspective. Where should I look? Ideally, I'd like a doc where I can find answers to questions like: - How do I create a :get route that takes optional parameters? With this, how could I write a query that will find a user if I ask either api/user?name=joe or api/user?id=42? - What exactly is :in $ ... - When is it needed to give an entity an explicit id property? I would imagine this is seldom needed, yet it seems to be supplied in each of the Vase samples, so I'm missing some fact here. - Etc.?


@mtnygard Ok, I added :pedantic? :abort, but same results. Here’s my dependencies, as given by lein deps :tree


Hmm, Slack is saying the snippet was truncated, but it’s all there. As far as I can tell there are no pedestal dependencies except the ones I get via pedestal-service and pedestal-jetty.


Anyway, just for a sanity check, I did a lein new pedestal-service pedestal-test, and that runs just fine. So I guess I’ll just copy over stuff until the new project also breaks.


@bradford I don’t have an answer for you but I’d recommend posting it to the pedestal-users group as well.


@bradford Here's the answer I got from Paul deGrandis: There is an option within :container-options called :configurator it's a function that takes and returns the Jetty Server argument it's the ultimate escape hatch to do whatever you want to the server *as the very last step in setting up the server* If it's not passed in, Pedestal sets the function to identity


@deg, thanks for the document suggestions. I was just wondering, though, were you able to find answers to those questions?


@ddeaguiar. Today's questions? No, not really. I did find some docs, mostly on the Datomic site, and now at least understand the syntax of the :in clause. But. my other questions still have me stumped, and are more at the Vase level.


Ok, re: parameters, have you seen the Handling Parameters section in the Your First API doc? (


Yup, I have read that. Am I missing something? It looks to me like all the parameters are reduced to positional and mandatory by the time they get to the query.


re: explicit entity ids, I suspect this has to do with Datomic best practices (


Re ids, that's what I figured, finally. So, best practice would be not to specify an explicit id unless I need it for some external purpose?


This makes complete sense, but is not the first impression that I got from the Vase samples.


So setting aside Vase for the moment, If you solely rely on the internal :db/id as an external identifier, it makes data migration more difficult


I need to think about what this means in terms of a Vase-enabled app, but IMHO it’s really not a Datomic-specific issue either. It’s a good recommendation for any backend store that generates identifiers


datomic has a notion of entity ids and :db/id is just one variant


I'll need to think about that, in the context of my current toy application. But, assuming that I do want an external id on my entities, does Vase (or Datomic?) give an easy way to generate unique ids atomically?


you can generate unique ids that are Datomic index-friendly using (datomic.api/squuid) (


Yup, I've seen that Datomic section, but have not fully grokked it yet. So, how would I use squuid in the context of a #vase/transact?


I think my questions really keep boiling down to "I'm trying to understand how to do things right, but I'm only learning from samples, rather than formal docs that don't yet exist"


so to assign your own unique id, you’d need to pass it as part of your entity data in vase transact but


I think Vase will append a :db/id if it’s not present as well


So you’d need to include both on transact


but I’d only query by the entity domain identifier


I need to go back and dig into Vase more deeply. My understanding of the internals is fuzzy so I’ll stop there before I inadvertently lead you astray.


Yes, Vase does seem to append the :db/id. But the samples, e.g., do also have a domain-specific identifier in the schema, but seem to assume that it somehow magically comes from the client, even on creation.


sure, it needs to come from the client


you can add an interceptor that appends it


I don’t think there’s a way to specify an attribute that get’s associated a value automatically upon transaction


my instinct tells me that, if anything, that’s would be done by an interceptor sitting in front of the transact action


At least that’s how I’d do it if I were building a Pedestal app


For the client to do it, would require some kind of guid, not just e.g. a simple counter maintained on the server. (But, as I write this, I'm thinking that I'm being naive, and not addressing scalability. So, maybe I'm just blowing smoke here).


In any event, this seems like a good paragraph to add somewhere into the docs.


Again, thanks for the great feedback. I realize that the docs are failing you atm. We’re looking to fix that


Any thoughts on my other question (how could I write a query that will find a user if I ask either api/user?name=joe or api/user?id=42)?


Thanks. I'm happy to keep helping with the docs, but my knowledge is still limited. I've made a few small PRs, but am afraid to document too much when I'm just guessing.


Regarding your query question, I don’t know off hand but I’d guess it’s doable using an or query predicate. I’d have to try it


To clarify, include both params in the :params collection, and use an or in the :query


But I’ve not tried it!


[I have to run... back in a bit, one fast reply] I did try or, but failed to get it to work; with an obscure error message.


hmm, I’m going to try that later today. I’m curious