Fork me on GitHub
#clojure
<
2016-03-21
>
jarodzz03:03:50

Hi, all. we are working on a project replay. when we receive like 10M requests at 24 hours per day in env A, the system needs to replay it in env B.

jarodzz03:03:38

any one have ideas how to make it work? like time sequence should all be the same.

jarodzz04:03:35

we are using it. thanks

adamkowalski05:03:14

what do you guys recommend as a web server? I am looking into jetty, http-kit, and immutant and those all seem pretty nice

qz06:03:10

most likely you would notice no difference if you choose one of those 3

ska16:03:51

Right now I am about to begin some piece of code that will be statefull internally. It is an authorized connection to a server which should automatically re-authorize when a token expires. How would you go about such a thing? Create a local atom with let and return a general function which takes a keyword arg what method to call on the server? Create a local atom and return a hashmap containing the various functions to call? Use a protocol and a record? Anything else?

ska16:03:33

@schaueho: I know, but the REST API is the way it is. Let's be all pragmatic about this 😉

schaueho16:03:31

memoize could also be an idea for storing the token

schaueho16:03:58

question is how do you recognize the token expired

lucj0616:03:06

Hi, I’m struggling since a couple of days to have my langohr client to consume RabbitMQ messages. I’m sure, I have a pb in the declare/bind part but cannot figure out where. http://pastebin.com/DcyxxAqy

lucj0616:03:08

any idea ?

lucj0616:03:48

my exchange is named data and the queue from which I want to get consume message is named « ALERT »

ska16:03:25

@schaueho: I will eventually get a HTTP 403. This is sessions based on auth tokens based on user creds. 403 Session expired => create new one with auth token, can't create because auth token expired => create new auth token based on user creds (which will be in the environment)

lucj0617:03:41

any idea regarding the RabbitMQ / langohr connection ?

lucj0617:03:00

I do not get any error. I just do not see the message to be consumed

spacepluk17:03:26

is anybody using hdfs from clojure and can recommend a wrapper library?

seb23118:03:16

@mikera: Just wanted to say thanks for core.matrix! I’ve been trying to make use of minimize in the incanter.optimise library, and it was just taking an age on the function I was attempting to optimise! I’ve just spent the afternoon refactoring my code to run with matrices and optimise now find the solution almost instantaneously! simple_smile

bridget19:03:12

The webhdfs-clj library does some things, spacepluk. It's an option. https://github.com/rdsr/webhdfs-clj

jamesleonis19:03:51

Hey @lucj06. I just got your code working on my machine with a local install of RMQ. Are you sure it’s publishing on that queue?

jamesleonis19:03:53

Double check the connection hostname, because it hangs for a looooong time when trying for a bad hostname

fommil19:03:20

I'd like to loop in a go block unless the out is closed. Is there a way to ask if a channel is closed?

Al Baker20:03:03

anyone ever see try* already refers to: #'potemkin.macros/try* in namespace: potemkin.collections on clj-http 2.1 and clojure 1.8.0 ?

johntrimble20:03:12

@bridget @spacepluk I thought I'd mention that I have been hesitant to use that library due to how it handles authentication: https://github.com/rdsr/webhdfs-clj/blob/master/src/webhdfs_clj/auth.clj#L28. I could be wrong, but it seems like that could result in your credentials being sent to a host other than the one you intended.

arohner20:03:23

fommil: not directly, AFAIK. (a/<! out) will return immediately if out is closed though

Al Baker20:03:14

hmmm, clojure 1.8 and potemkin really don't like eachother

lucj0620:03:23

@jamesleonis: thanks, I’ll test this right away !!!

hiredman20:03:53

albaker: if I recall there were a number of mailing list threads about it, and I think the latest potemkin should be all fixed, but I don't have first hand experience

Al Baker20:03:00

they all say upgrade potemkin, which as far as I can see -- it still fails

hiredman20:03:38

well, check the usual suspects, do you have stale classes, check lein deps :tree

Al Baker20:03:12

nothing else depends on potemkin

fommil20:03:26

>! returns false if the channel is closed, I think I can work with that

lucj0620:03:41

@jamesleonis: in your code, the publish does not seems to be done on the ALERT queue (lb/publish ch ex "" "Hello") but to the one with empty name (meaning all existing queue bind to this exchange ?), while the consumer listens on the ALERT queue. If I change the publisher to (lb/publish ch ex "ALERT"  "Hello") the consumer does not get the message anymore (not displayed in the REPL)

nkraft20:03:27

@spacepluk: Depends on what you want to do with hdfs. I use Parkour quite a bit, but if you need something lower level, I usually just wrap the Apache java libraries.

jamesleonis20:03:39

@lucj06: The Publisher isn’t aware of the queues. It can only publish based on routing keys. The 3rd param above is for the routing key, but there isn’t a :routing-key declared on your bind function, so it doesn’t know to look for it.

Al Baker20:03:53

hmm, this makes me want to do a PR on clj-http and get potemkin out of there

jamesleonis20:03:02

for (lb/publish ch ex "ALERT" "Hello”) to work, you need something like (lq/bind ch queue-name topic-name :routing-key “ALERT”)

lucj0620:03:13

@jamesleonis: ok, got it. because in the example, the queue-name set to « ALERT » does not have any influence in fact

lucj0620:03:22

it is not taken into account

fommil20:03:19

is there a way to require dynamic variables from a namespace without the prefix? (without having to write each one out by hand)

fommil20:03:41

and without importing all the functions into :refer :all

fommil20:03:51

i.e. I have a file twitter.clj with a couple of dynamic variables, and a couple of functions. I want to import all the functions :as twitter but be able to :refer to the dynamic variables

lucj0621:03:43

@jamesleonis: thanks for your help, I will check my server configuration. I think I messed up the routing key and queue names.

spacepluk21:03:46

@bridget thanks I'll take a look :)

spacepluk21:03:44

@nkraft I only need the file system stuff

bfabry22:03:13

@fommil (require ['clojure.core :refer (map :name (filter :dynamic (map meta (vals (ns-publics 'clojure.core)))))])

bfabry22:03:49

will only work after having req'd the ns already, but you wanted that anyway

bfabry22:03:36

so (require '[twitter :as twit]) (require ['twitter :as 'twit :refer (map :name (filter :dynamic (map meta (vals (ns-publics 'twitter)))))])