In each of the following labs you'll explore a different aspect of Oracle
Functions from creating, to deploying, to troubleshooting, to invoking. In all
cases you'll be using the fn
CLI extensively so you may find these references
helpful:
Now that fn
CLI is installed and your development envirionment is configured,
we can dig into creating and running functions. In this lab you'll create,
deploy, and run a Node.js function. If you aren't a Node.js programmer, don't
panic! All the code is provided and is pretty easy to understand. The focus of
this tutorial is on becoming familiar with the basics of Fn, not Node.js
programming.
So let's create and deploy your first function.
Fn provides an FDK (Function Development Kit) for each of the core supported programming languages. But the Java FDK is the most advanced with support for Maven builds, automatic function argument type conversions, and comprehenive support for function testing with JUnit.
The Introduction to Java Functions lab covers all these topics and more.
If you've been following the instructions in the tutorials carefully you shouldn't have run into any unexpected failures--hopefully!! But in real life when you're writing code things go wrong--builds fail, exceptions are thrown, etc. Fortunately the Troubleshooting tutorial introduces techniques you can use to track down the source of a failure.
OCI Events service lets you monitor OCI resource changes and send notifications and/or trigger a function automatically in response to that change. We'll explore sending email notifications, and invoking a function via the OCI Events when an image is uploaded to an OCI Object Storage bucket in Automatically invoke Functions using OCI Events.
Functions can be invoked over HTTP using their "invoke endpoint". You can either invoke the endpoint directly or use the OCI SDK to both manage and invoke functions. We'll explore how to invoke a function using:
One of the coolest features of Fn is that while it's easy to write functions in various programming languages, you can also deploy Docker images as functions. This opens up entire worlds of opportunity as you can package existing code, utilities, or use a programming language not yet supported by Fn. Try the Containers as Functions tutorial to see how easy it is.