This example shows how easy it is to develop a funktion in Java.
The source code consists of:
- funktion.yml to define the trigger URL (in this case HTTP)
- main() function in Java to process incoming events
You can then run your funktion locally via:
mvn
You can then invoke it via your web browser at http://localhost:8080/?name=Funktion
Assuming your current shell is connected to Kubernetes or OpenShift so that you can type a command like
kubectl get pods
or for OpenShift
oc get pods
Then the following command will package your funktion and run it on Kubernetes:
mvn install fabric8:deploy