Fork me on GitHub

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.


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


we are using it. thanks


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


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


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?


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


memoize could also be an idea for storing the token


question is how do you recognize the token expired


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.


any idea ?


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


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


any idea regarding the RabbitMQ / langohr connection ?


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


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


@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


The webhdfs-clj library does some things, spacepluk. It's an option.


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?


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


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 ?


@bridget @spacepluk I thought I'd mention that I have been hesitant to use that library due to how it handles authentication: 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.


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


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


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


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

Al Baker20:03:12

nothing else depends on potemkin


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


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


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


@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


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


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


it is not taken into account


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


and without importing all the functions into :refer :all


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


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


@bridget thanks I'll take a look :)


@nkraft I only need the file system stuff


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


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


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