pedestal

penryu 2019-11-26T06:36:02.091900Z

I may just have lost my google fu for the evening with all the excitement leading up to the holiday, but I'm having the hardest time finding out how to deploy a pedestal app (the hello world app from the Getting Started tutorial) on netty.

penryu 2019-11-26T06:37:20.092700Z

The pedestal homepage says it support netty deployment, but the list item for Netty on http://pedestal.io/reference/index is frustratingly not clickable.

penryu 2019-11-26T06:38:00.093300Z

Am I just blind, or am I ignorant of something obvious everyone else knows?

penryu 2019-11-26T07:00:57.094Z

I should probably say, I'm using deps.edn, and I'm used to lein.

penryu 2019-11-26T07:04:39.094800Z

Maybe I'm expecting a way to deploy a jar for java -jar my-app.jar, and I'm just supposed to clj ......

dangercoder 2019-11-26T10:21:32.095500Z

I used https://github.com/seancorfield/depstar to build an uberjar (.jar) with deps.edn,

penryu 2019-11-26T14:02:42.102600Z

@jarvinenemil Thank you for the response! I’ve found several options for packaging the app, and @seancorfield’s fork of depstar was the first result and it worked! But I’m still stumped on how to use the Netty support the pedestal documentation mentioned. Do you have any pointers?

dangercoder 2019-11-26T14:06:54.105700Z

@penryu Glad to hear that. I hope someone will reply regarding Netty, I have no idea 🙂. If you get no help here regarding Netty I would ask here: https://groups.google.com/forum/#!forum/pedestal-users https://clojureverse.org/ https://ask.clojure.org/ If you get no replies on thoose forums (which is unlikely) you will have to dig into the pedstal code-base: https://github.com/pedestal/pedestal

penryu 2019-11-26T18:03:23.106300Z

Thanks for the tips! After seeing this, I did some of my due diligence and didn't find any mention of netty anywhere in the source, except in docs mentioning it was supported. My concern now is that either • it was removed without updating the docs, or • it's some plugin or magic value an experienced pedestal dev would know, but hasn't been written down I'll follow up on one of those sites. Thanks again!

hlship 2019-11-26T22:02:44.109200Z

Has anyone looked into the idea of separating routing into two stages: 1) identifying the route and 2) adding' the selected routes interceptors to the queue? Why would you want that? In our case, we get a lot of garbage requests hitting our servers, stuff (usually from internal security) probing for known weaknesses (as if we were running unpatched IIS or something). We don't like to clutter our logs with those,so we have a whitelist interceptor that does some regexp on the request and rejects non-matching requests before we even log. However, we need to keep the whitelist synchronized with actual routing. It would be nice if the routing table itself could act as a white list.

2019-11-26T22:21:31.110Z

@hlship that’s how the router spec works (2 stages). It’s just not exposed

2019-11-26T22:21:51.110200Z

match then enqueue

hlship 2019-11-26T22:25:25.110500Z

I'll look at the code, maybe find a way to split the two.

2019-11-26T22:26:55.111100Z

The bits are here https://github.com/pedestal/pedestal/blob/master/route/src/io/pedestal/http/route.clj#L440-L451. Perhaps you can roll your own impl.

hlship 2019-11-26T22:42:27.111800Z

I was just looking at that code. I wish it was already in two parts.