This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.fn; | |
| public class HelloFunction { | |
| public String handleRequest(String input) { | |
| var result = | |
| switch (input.toUpperCase()) | |
| { | |
| case "MONDAY", "TUESDAY" -> "Get back to work! "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ trsharp@MacBook-Pro-2 ~/Projects/fn/atp-demo-fn-1$ echo -n "friday" | fn invoke atp-demo-app atp-demo-fn-1 | |
| Prepare plan for the weekend! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM maven:3.6.0-jdk-12-alpine as build-stage | |
| WORKDIR /function | |
| ENV MAVEN_OPTS -Dhttp.proxyHost= -Dhttp.proxyPort= -Dhttps.proxyHost= -Dhttps.proxyPort= -Dhttp.nonProxyHosts= -Dmaven.repo.local=/usr/share/maven/ref/repository | |
| ADD pom.xml /function/pom.xml | |
| ADD src /function/src | |
| RUN ["mvn", "package", \ | |
| "dependency:copy-dependencies", \ | |
| "-DincludeScope=runtime", \ | |
| "-Dmdep.prependGroupId=true", \ | |
| "-DoutputDirectory=target" ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn config app atp-demo-app DB_PASSWORD [Password Value] | |
| fn config app atp-demo-app DB_URL [jdbc:oracle:thin:@db_LOW] | |
| fn config app atp-demo-app DB_USER [schema user] | |
| fn config app atp-demo-app KEYSTORE_PASSWORD [Wallet Password] | |
| fn config app atp-demo-app TRUSTSTORE_PASSWORD [Wallet Password] | |
| fn config app atp-demo-app CLIENT_CREDENTIALS /function/wallet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.fn; | |
| import com.cedarsoftware.util.io.JsonWriter; | |
| import com.fnproject.fn.api.OutputEvent; | |
| import java.util.HashMap; | |
| public class HelloFunction { | |
| public OutputEvent handleRequest(String input) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trsharp@MacBook-Pro-2 ~/Projects/fn/atp-demo-fn-1$ fn invoke atp-demo-app atp-demo-fn-1 | |
| {"@type":"java.util.HashMap","user":"faas"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE EMPLOYEES ( | |
| EMP_EMAIL VARCHAR2(100 BYTE) NOT NULL | |
| , EMP_NAME VARCHAR2(100 BYTE) | |
| , EMP_DEPT VARCHAR2(50 BYTE) | |
| , CONSTRAINT PK_EMP PRIMARY KEY ( EMP_EMAIL ) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <dependency> | |
| <groupId>com.oracle.jdbc</groupId> | |
| <artifactId>ojdbc8</artifactId> | |
| <version>18.3.0.0</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>com.oracle.jdbc</groupId> | |
| <artifactId>oraclepki</artifactId> | |
| <version>18.3.0.0</version> | |
| </dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <dependency> | |
| <groupId>com.oracle.jdbc</groupId> | |
| <artifactId>ojdbc8</artifactId> | |
| <version>18.3.0.0</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>com.oracle.jdbc</groupId> | |
| <artifactId>oraclepki</artifactId> | |
| <version>18.3.0.0</version> | |
| </dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM maven:3.6.0-jdk-12-alpine as build-stage | |
| WORKDIR /function | |
| ENV MAVEN_OPTS -Dhttp.proxyHost= -Dhttp.proxyPort= -Dhttps.proxyHost= -Dhttps.proxyPort= -Dhttp.nonProxyHosts= -Dmaven.repo.local=/usr/share/maven/ref/repository | |
| ADD pom.xml /function/pom.xml | |
| ADD src /function/src | |
| ADD build-resource/libs/* /function/build-resource/libs/ | |
| RUN ["mvn", "install:install-file", "-Dfile=/function/build-resource/libs/ojdbc8.jar", "-DgroupId=com.oracle.jdbc", "-DartifactId=ojdbc8", "-Dversion=18.3.0.0", "-Dpackaging=jar"] | |
| RUN ["mvn", "install:install-file", "-Dfile=/function/build-resource/libs/oraclepki.jar", "-DgroupId=com.oracle.jdbc", "-DartifactId=oraclepki", "-Dversion=18.3.0.0", "-Dpackaging=jar"] | |
| RUN ["mvn", "install:install-file", "-Dfile=/function/build-resource/libs/osdt_core.jar", "-DgroupId=com.oracle.jdbc", "-DartifactId=osdt_core", "-Dversion=18.3.0.0", "-Dpackaging=jar"] |