fnproject / fdk-java

Java API and runtime for fn.
Apache License 2.0
142 stars 53 forks source link

Add Fn-Fdk-Version to java fdk #222

Closed zootalures closed 4 years ago

zootalures commented 4 years ago

This adds Fn-Fdk-Version to each response from the FDK - this allows services to track which version of the FDK is in use at a given time.

In addition to the specific FDK version java has several variants (java version, graal vs openJDK)

Per discusion with @roroco - I've added a comment to the version header that encodes these

This uses maven placeholders to rewrite the version number into a string literal - this is done to reduce startup time (by avoiding having to load resources at startup) and remove the need for substrate functions to explicitly include resources in their build configuration.

the new header looks like this for graal:

 Fn-Fdk-Version: fdk-java/1.0.0-SNAPSHOT (jvm=Substrate VM, jvmv=1.8.0_222)

and for openjdk:

 Fn-Fdk-Version: fdk-java/1.0.0-SNAPSHOT (jvm=OpenJDK 64-Bit Server VM, jvmv=11.0.6)