Fork me on GitHub
#holy-lambda
<
2022-11-10
>
Chris Lowe10:11:47

@karol.wojcik is it possible to invoke a lambda from the command line?

java  -jar .holy-lambda/build/output.jar "example.core.MyLambda" 
WARNING: abs already refers to: #'clojure.core/abs in namespace: cljc.java-time.duration, being replaced by: #'cljc.java-time.duration/abs
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.toString()" because "runtime" is null
	at fierycod.holy_lambda.custom_runtime$url.invokeStatic(custom_runtime.clj:8)
	at fierycod.holy_lambda.custom_runtime$next_iter.invokeStatic(custom_runtime.clj:63)
	at fierycod.holy_lambda.custom_runtime$next_iter.invoke(custom_runtime.clj:63)
	at clojure.lang.Var.invoke(Var.java:399)
	at example.core$_main.invokeStatic(core.clj:192)
	at example.core$_main.doInvoke(core.clj:192)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at example.core.main(Unknown Source)
Presumably, I need to get a payload to the function? Do you happen to know what format that might take?

Chris Lowe11:11:54

I should clarify that I know I can use sam invoke for interacting with my lambda. My goal here is to run the app as part of a docker build to capture shared class data:

RUN java -XX:ArchiveClassesAtExit=classes.jsa -jar output.jar "example.core.MyLambda"

CMD java -XX:SharedArchiveFile=classes.jsa -jar output.jar "example.core.MyLambda"

Chris Lowe12:11:06

I figured it out. Will detail my method later if anyone’s interested

Karol Wójcik07:11:21

As I remember there is executor JVM property I’m using to gather reflective calls.