portkey 2017-10-07

Btw I’m in the twilight zone: more logging reveals it’s my class that has extra fields… matching a jdk7 implementation while there’s no such thing on the class path.…

baptiste-from-paris 2017-10-07T14:18:40.000025Z

hello all, little update. 1) I run a little lambda/portkey that send emails to customer in prod (for real clients) 2) I have a personal objective, understanding all that is happening in portkey I am currently playing with ouroboros, just got how to attach an Angent to the running vm, next step is understanding what’s happening with transformer’s functions. Thanks you for helping me understand global design

👍 1

akh, we can’t loose Christophe to the twilight zone of java classes

baptiste-from-paris 2017-10-07T15:15:35.000070Z

lol

baptiste-from-paris 2017-10-07T15:20:47.000005Z

by the way, do you know why when I launch the REPL I can retrieve the VM with attach but once I try do to it in my REPL I have this error UnsatisfiedLinkError Native Library /Applications/IntelliJ IDEA CE.app/Contents/jdk/Contents/Home/jre/lib/libattach.dylib already loaded in another classloader java.lang.ClassLoader.loadLibrary0 (ClassLoader.java:1907)

@baptiste-from-paris I’m a bit at lost between the two REPLs mentioned. Could you be more specific?

baptiste-from-paris 2017-10-09T08:54:07.000059Z

don’t worry about this one, it’s indeed IntelliJ IDE

baptiste-from-paris 2017-10-09T08:54:20.000240Z

If I use a classic REPL, all is working great

and do you know if it’s IntelliJ or Cursive (before I pester Colin)?

baptiste-from-paris 2017-10-09T12:19:26.000031Z

let me check that

baptiste-from-paris 2017-10-09T12:27:00.000112Z

but how could I really know, cursive might use instrumentation also right ?

hum, Colin might know where to look anyway

Launch a java process with clojure.Main and the right classpath.

baptiste-from-paris 2017-10-10T08:00:44.000514Z

@cgrand sorry for the delay, it’s working great with clojure.main repl

baptiste-from-paris 2017-10-10T08:00:59.000082Z

must be a cursive “bug” or design

hum, ps aux while running repl from Cursive would reveal classpath generated by intellij for the subprocess, and maybe hint at what is happening

baptiste-from-paris 2017-10-10T12:27:53.000348Z

/Applications/IntelliJ IDEA CE.app/Contents/jdk/Contents/Home/jre/bin/java -javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=54123:/Applications/IntelliJ IDEA CE.app/Contents/bin

@baptiste-from-paris could you try (Class/forName "com.sun.tools.attach.VirtualMachine") in a Cursive-sans-portkey repl?

baptiste-from-paris 2017-10-11T06:50:21.000179Z

ok, do that right now + I now have full notifications for this channel ^^

baptiste-from-paris 2017-10-11T06:52:40.000207Z

so, in a randam project clj repl WITH cursive and WITHOUT portkey, it’s working

baptiste-from-paris 2017-10-11T06:52:51.000011Z

(let [loader (.getContextClassLoader (java.lang.Thread/currentThread))
      tools-jar (java.io.File. (System/getProperty "java.home") "../lib/tools.jar")
      tools-jar-loader (java.net.URLClassLoader. (into-array [(.toURL tools-jar)]))
      [_ pid] (re-matches #"([^@]*).*" (.getName (java.lang.management.ManagementFactory/getRuntimeMXBean)))]

  (-> (Class/forName "com.sun.tools.attach.VirtualMachine" true tools-jar-loader)
      (.getMethod "attach" (into-array [String]))
      (.invoke nil (object-array [pid]))))
=> #object[sun.tools.attach.BsdVirtualMachine 0x5d8f3c00 "sun.tools.attach.BsdAttachProvider@78025dc1: 2327"]

baptiste-from-paris 2017-10-07T15:21:10.000053Z

with this one in the REPL

(-> (Class/forName "com.sun.tools.attach.VirtualMachine" true tools-jar-loader)
          (.getMethod "attach" (into-array [String]))
          (.invoke nil (object-array [pid])))

hmm, same native library already loaded by IntelliJ?

“In another class loader” is an interesting twist. Open issue please.

been using cider with nrepl so haven’t noticed, should try IntelliJ myselkf

baptiste-from-paris 2017-10-07T15:30:22.000053Z

worked with both, and I found out that they are both excellent tools but I really love class navigation of IntelliJ products

yes, I use it for Java browsing also

and I have to thank you also, it’s really good to have someone embarking on a journey with portkey 🙂

baptiste-from-paris 2017-10-07T20:20:52.000021Z

thx ^^

baptiste-from-paris 2017-10-07T20:25:16.000079Z

But the road will be long for me ^_^

whoa, was looking at creating unmount! and undeploy! to have tests that actually hit api gateway, so that I can be a bit more certain on my code that uses aws, and for this I’d need to clean after test and maybe users would wan’t to clean mounts as well. Now that I say this, for tests I probably could just remove the whole API, but there was a limit on API deletions per minute that I hit quite easily http://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html, which is 2 per minute. Then again this could be done after running all tests.

anyways, had a problem with aws-clj-sdk (apigw/get-resources) returning only first 25 items and I have more deployed

reading the code (https://github.com/portkey-cloud/aws-clj-sdk/blob/master/src/portkey/aws.clj#L216), figured out that I can just pass query parameters of the actual rest api (https://docs.aws.amazon.com/apigateway/api-reference/link-relation/restapi-resources/) in the body, like (apigw/get-resources {:rest-api-id "xxxx" :limit 100})

hmm, the link tracing for pagination though…