dengjia 1 mesiac pred
commit
f6f1436194
100 zmenil súbory, kde vykonal 4859 pridanie a 0 odobranie
  1. 20 0
      .gitignore
  2. 300 0
      .style/alibaba.xml
  3. 605 0
      .style/eclipse-codestyle.xml
  4. 9 0
      .style/suppressions.xml
  5. 8 0
      README.md
  6. 129 0
      java11-blank-http/README.md
  7. BIN
      java11-blank-http/assets/20220408141134.jpg
  8. BIN
      java11-blank-http/assets/20220408143909.jpg
  9. 49 0
      java11-blank-http/dependency-reduced-pom.xml
  10. 59 0
      java11-blank-http/pom.xml
  11. 57 0
      java11-blank-http/readme_s.md
  12. 41 0
      java11-blank-http/readme_s_en.md
  13. 75 0
      java11-blank-http/s.yaml
  14. 89 0
      java11-blank-http/s_en.yaml
  15. 33 0
      java11-blank-http/src/main/java/example/App.java
  16. BIN
      java11-blank-http/target/classes/example/App.class
  17. 1 0
      java11-blank-http/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  18. 1 0
      java11-blank-http/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  19. 84 0
      java11-blank-pojo-event/README.md
  20. BIN
      java11-blank-pojo-event/assets/20220608155705.jpg
  21. BIN
      java11-blank-pojo-event/assets/20220608155906.jpg
  22. 49 0
      java11-blank-pojo-event/dependency-reduced-pom.xml
  23. 4 0
      java11-blank-pojo-event/event.json
  24. 59 0
      java11-blank-pojo-event/pom.xml
  25. 57 0
      java11-blank-pojo-event/readme_s.md
  26. 41 0
      java11-blank-pojo-event/readme_s_en.md
  27. 60 0
      java11-blank-pojo-event/s.yaml
  28. 74 0
      java11-blank-pojo-event/s_en.yaml
  29. 15 0
      java11-blank-pojo-event/src/main/java/example/PojoHandler.java
  30. 33 0
      java11-blank-pojo-event/src/main/java/example/SimpleRequest.java
  31. 22 0
      java11-blank-pojo-event/src/main/java/example/SimpleResponse.java
  32. BIN
      java11-blank-pojo-event/target/classes/example/PojoHandler.class
  33. BIN
      java11-blank-pojo-event/target/classes/example/SimpleRequest.class
  34. BIN
      java11-blank-pojo-event/target/classes/example/SimpleResponse.class
  35. 3 0
      java11-blank-pojo-event/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  36. 3 0
      java11-blank-pojo-event/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  37. 82 0
      java11-blank-stream-event/README.md
  38. BIN
      java11-blank-stream-event/assets/20220608154125.jpg
  39. BIN
      java11-blank-stream-event/assets/20220608154802.jpg
  40. 49 0
      java11-blank-stream-event/dependency-reduced-pom.xml
  41. 1 0
      java11-blank-stream-event/event.txt
  42. 59 0
      java11-blank-stream-event/pom.xml
  43. 57 0
      java11-blank-stream-event/readme_s.md
  44. 41 0
      java11-blank-stream-event/readme_s_en.md
  45. 60 0
      java11-blank-stream-event/s.yaml
  46. 74 0
      java11-blank-stream-event/s_en.yaml
  47. 28 0
      java11-blank-stream-event/src/main/java/example/StreamHandler.java
  48. BIN
      java11-blank-stream-event/target/classes/example/StreamHandler.class
  49. 1 0
      java11-blank-stream-event/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  50. 1 0
      java11-blank-stream-event/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  51. 88 0
      java11-mongodb/README.md
  52. 49 0
      java11-mongodb/dependency-reduced-pom.xml
  53. 66 0
      java11-mongodb/pom.xml
  54. 67 0
      java11-mongodb/s.yaml
  55. 53 0
      java11-mongodb/src/main/java/example/App.java
  56. BIN
      java11-mongodb/target/classes/example/App.class
  57. 1 0
      java11-mongodb/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  58. 1 0
      java11-mongodb/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  59. 148 0
      java11-mysql/README.md
  60. BIN
      java11-mysql/assets/20220411105111.jpg
  61. BIN
      java11-mysql/assets/20220411105312.jpg
  62. 49 0
      java11-mysql/dependency-reduced-pom.xml
  63. 67 0
      java11-mysql/pom.xml
  64. 57 0
      java11-mysql/readme_s.md
  65. 41 0
      java11-mysql/readme_s_en.md
  66. 69 0
      java11-mysql/s.yaml
  67. 74 0
      java11-mysql/s_en.yaml
  68. 133 0
      java11-mysql/src/main/java/example/App.java
  69. BIN
      java11-mysql/target/classes/example/App.class
  70. 1 0
      java11-mysql/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  71. 1 0
      java11-mysql/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  72. 81 0
      java11-oss/README.md
  73. BIN
      java11-oss/assets/20220608161024.jpg
  74. 49 0
      java11-oss/dependency-reduced-pom.xml
  75. 67 0
      java11-oss/pom.xml
  76. 57 0
      java11-oss/readme_s.md
  77. 41 0
      java11-oss/readme_s_en.md
  78. 63 0
      java11-oss/s.yaml
  79. 74 0
      java11-oss/s_en.yaml
  80. 43 0
      java11-oss/src/main/java/example/App.java
  81. BIN
      java11-oss/target/classes/example/App.class
  82. 1 0
      java11-oss/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  83. 1 0
      java11-oss/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  84. 103 0
      mongodb-java-http/README.md
  85. 91 0
      mongodb-java-http/publish.yaml
  86. 2 0
      mongodb-java-http/src/Makefile
  87. 103 0
      mongodb-java-http/src/README.md
  88. 49 0
      mongodb-java-http/src/code/dependency-reduced-pom.xml
  89. 66 0
      mongodb-java-http/src/code/pom.xml
  90. 61 0
      mongodb-java-http/src/code/src/main/java/example/App.java
  91. BIN
      mongodb-java-http/src/code/target/classes/example/App.class
  92. 1 0
      mongodb-java-http/src/code/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  93. 1 0
      mongodb-java-http/src/code/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  94. 65 0
      mongodb-java-http/src/s.yaml
  95. 91 0
      mongodb-java/publish.yaml
  96. 117 0
      mongodb-java/readme.md
  97. 2 0
      mongodb-java/src/Makefile
  98. 117 0
      mongodb-java/src/README.md
  99. 49 0
      mongodb-java/src/code/dependency-reduced-pom.xml
  100. 66 0
      mongodb-java/src/code/pom.xml

+ 20 - 0
.gitignore

@@ -0,0 +1,20 @@
+.DS_Store
+.idea/
+*/.idea/
+*/.s
+*/*/.s
+*/*/*/.s
+*/*/*/bin
+*/*/*/obj
+*/*/*/*/.s
+*/*.bak
+*/*/*.bak
+*/*/*.test
+*/*/s_dev.yml
+*/*/*/src/s_dev.yaml
+java/*/target/
+*/*/*/src/code/target
+.vscode
+node_modules
+package-lock.json
+*/*/target

+ 300 - 0
.style/alibaba.xml

@@ -0,0 +1,300 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+        "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
+        "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
+
+<module name="Checker">
+    <module name="SuppressionFilter">
+        <property name="file" value=".style/suppressions.xml"/>
+    </module>
+    <module name="SuppressWarningsFilter"/>
+    <!-- 检查文件是否以一个空行结束 -->
+    <module name="NewlineAtEndOfFile">
+<!--        <property name="severity" value="warning"/>-->
+    </module>
+
+    <!-- 文件长度不超过1500行 -->
+    <module name="FileLength">
+        <property name="max" value="1500"/>
+        <property name="severity" value="warning"/>
+    </module>
+
+    <!-- 每行不超过160个字符 -->
+    <module name="LineLength">
+        <property name="max" value="160"/>
+<!--        <property name="severity" value="warning"/>-->
+    </module>
+
+    <!-- 每个java文件一个语法树 -->
+    <module name="TreeWalker">
+        <module name="SuppressWarningsHolder"/>
+        <!-- import检查-->
+        <!-- 检查是否从非法的包中导入了类 -->
+        <module name="IllegalImport">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查是否导入了多余的包 -->
+        <module name="RedundantImport">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 没用的import检查,比如:1.没有被用到2.重复的3.import java.lang的4.import 与该类在同一个package的 -->
+        <module name="UnusedImports">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 不允许import* -->
+        <module name="AvoidStarImport"/>
+
+        <!-- 注释检查 -->
+        <!-- 检查构造函数的javadoc -->
+        <module name="JavadocType">
+<!--            <property name="severity" value="warning"/>-->
+            <property name="allowUnknownTags" value="true"/>
+            <message key="javadoc.missing" value="类注释:缺少Javadoc注释。"/>
+        </module>
+
+        <!-- 命名检查 -->
+        <!-- 局部的final变量,包括catch中的参数的检查 -->
+        <module name="LocalFinalVariableName">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 局部的非final型的变量,包括catch中的参数的检查 -->
+        <module name="LocalVariableName">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 包名的检查(只允许小写字母),默认^[a-z]+(\.[a-zA-Z_][a-zA-Z_0-9_]*)*$ -->
+        <module name="PackageName">
+<!--            <property name="severity" value="warning"/>-->
+            <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
+            <message key="name.invalidPattern" value="包名 ''{0}'' 要符合 ''{1}''格式."/>
+        </module>
+        <!-- 仅仅是static型的变量(不包括static final型)的检查 -->
+        <module name="StaticVariableName">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- Class或Interface名检查,默认^[A-Z][a-zA-Z0-9]*$-->
+        <module name="TypeName">
+<!--            <property name="severity" value="warning"/>-->
+            <message key="name.invalidPattern" value="名称 ''{0}'' 要符合 ''{1}''格式."/>
+        </module>
+        <!-- 非static型变量的检查 -->
+        <module name="MemberName">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 方法名的检查 -->
+        <module name="MethodName">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 方法的参数名 -->
+        <module name="ParameterName ">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 常量名的检查(只允许大写),默认^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$ -->
+        <module name="ConstantName">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+
+        <!-- 定义检查 -->
+        <!-- 检查数组类型定义的样式 -->
+        <module name="ArrayTypeStyle">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查long型定义是否有大写的“L” -->
+        <module name="UpperEll">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+
+        <!-- 长度检查 -->
+        <!-- 方法不超过200行 -->
+        <module name="MethodLength">
+<!--            <property name="severity" value="warning"/>-->
+            <property name="tokens" value="METHOD_DEF"/>
+            <property name="max" value="200"/>
+        </module>
+        <!-- 方法的参数个数不超过5个。 并且不对构造方法进行检查-->
+        <module name="ParameterNumber">
+<!--            <property name="severity" value="warning"/>-->
+            <property name="max" value="5"/>
+            <property name="ignoreOverriddenMethods" value="true"/>
+            <property name="tokens" value="METHOD_DEF"/>
+        </module>
+
+        <!-- 空格检查-->
+        <!-- 方法名后跟左圆括号"(" -->
+        <module name="MethodParamPad">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 在类型转换时,不允许左圆括号右边有空格,也不允许与右圆括号左边有空格 -->
+        <module name="TypecastParenPad">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查在某个特定关键字之后应保留空格 -->
+        <module name="NoWhitespaceAfter">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查在某个特定关键字之前应保留空格 -->
+        <module name="NoWhitespaceBefore">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 操作符换行策略检查 -->
+        <module name="OperatorWrap">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 圆括号空白 -->
+        <module name="ParenPad">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查分隔符是否在空白之后 -->
+        <module name="WhitespaceAfter">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查分隔符周围是否有空白 -->
+        <module name="WhitespaceAround">
+<!--            <property name="severity" value="warning"/>-->
+            <property name="allowEmptyConstructors" value="true"/>
+            <property name="allowEmptyLambdas" value="true"/>
+            <property name="allowEmptyMethods" value="true"/>
+            <property name="allowEmptyTypes" value="true"/>
+            <property name="allowEmptyLoops" value="true"/>
+            <property name="ignoreEnhancedForColon" value="false"/>
+            <property name="tokens"
+                      value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR,
+                    BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND,
+                    LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY,
+                    LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED,
+                    LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN,
+                    NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR,
+                    SR_ASSIGN, STAR, STAR_ASSIGN, LITERAL_ASSERT, TYPE_EXTENSION_AND"/>
+            <message key="ws.notFollowed"
+                     value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
+            <message key="ws.notPreceded"
+                     value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
+        </module>
+
+        <!-- 修饰符检查 -->
+        <!-- 检查修饰符的顺序是否遵照java语言规范,默认public、protected、private、abstract、static、final、transient、volatile、synchronized、native、strictfp -->
+        <module name="ModifierOrder">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查接口和annotation中是否有多余修饰符,如接口方法不必使用public -->
+        <module name="RedundantModifier">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+
+        <!-- 代码块检查 -->
+        <!-- 检查是否有嵌套代码块 -->
+        <module name="AvoidNestedBlocks">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查是否有空代码块 -->
+        <module name="EmptyBlock">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查左大括号位置 -->
+        <module name="LeftCurly">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查代码块是否缺失{} -->
+        <module name="NeedBraces">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查右大括号位置 -->
+        <module name="RightCurly">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+
+        <!-- 代码检查 -->
+        <!-- 检查空的代码段 -->
+        <module name="EmptyStatement">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查在重写了equals方法后是否重写了hashCode方法 -->
+        <module name="EqualsHashCode">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查局部变量或参数是否隐藏了类中的变量 -->
+        <module name="HiddenField">
+            <property name="tokens" value="VARIABLE_DEF"/>
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查子表达式中是否有赋值操作 -->
+        <module name="InnerAssignment">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查switch语句是否有default -->
+        <module name="MissingSwitchDefault">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查是否有过度复杂的布尔表达式 -->
+        <module name="SimplifyBooleanExpression">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查是否有过于复杂的布尔返回代码段 -->
+        <module name="SimplifyBooleanReturn">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+
+        <!-- 类设计检查 -->
+        <!-- 检查类是否为扩展设计l -->
+        <!-- 检查只有private构造函数的类是否声明为final -->
+        <module name="FinalClass">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查接口是否仅定义类型 -->
+        <module name="InterfaceIsType">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 检查类成员的可见度 检查类成员的可见性。只有static final 成员是public的 
+        除非在本检查的protectedAllowed和packagedAllowed属性中进行了设置-->
+        <module name="VisibilityModifier">
+<!--            <property name="severity" value="warning"/>-->
+            <property name="packageAllowed" value="true"/>
+            <property name="protectedAllowed" value="true"/>
+        </module>
+
+        <!-- 语法 -->
+        <!-- String的比较不能用!= 和 == -->
+        <module name="StringLiteralEquality">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- 限制for循环最多嵌套2层 -->
+        <module name="NestedForDepth">
+<!--            <property name="severity" value="warning"/>-->
+            <property name="max" value="2"/>
+        </module>
+        <!-- if最多嵌套3层 -->
+        <module name="NestedIfDepth">
+<!--            <property name="severity" value="warning"/>-->
+            <property name="max" value="3"/>
+        </module>
+        <!-- 检查未被注释的main方法,排除以Appllication结尾命名的类 -->
+        <module name="UncommentedMain">
+<!--            <property name="severity" value="warning"/>-->
+            <property name="excludedClasses" value=".*[Application,Test]$"/>
+        </module>
+        <!-- 禁止使用System.out.println -->
+        <module name="Regexp">
+<!--            <property name="severity" value="warning"/>-->
+            <property name="format" value="System\.out\.println"/>
+            <property name="illegalPattern" value="true"/>
+        </module>
+        <!-- return个数 3个-->
+        <module name="ReturnCount">
+<!--            <property name="severity" value="warning"/>-->
+            <property name="max" value="3"/>
+        </module>
+        <!--try catch 异常处理数量 3-->
+        <module name="NestedTryDepth ">
+<!--            <property name="severity" value="warning"/>-->
+            <property name="max" value="3"/>
+        </module>
+        <!-- clone方法必须调用了super.clone() -->
+        <module name="SuperClone">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+        <!-- finalize 必须调用了super.finalize() -->
+        <module name="SuperFinalize">
+<!--            <property name="severity" value="warning"/>-->
+        </module>
+
+    </module>
+</module>

+ 605 - 0
.style/eclipse-codestyle.xml

@@ -0,0 +1,605 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<profiles version="12">
+    <profile kind="CodeFormatterProfile" name="P3C-CodeStyle" version="13">
+        <!--可变参数的... Idea没有对应的配置项,强制insert-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
+        <!--枚举值之间 Idea没有对应的配置项,强制insert-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=Java:SPACE_BEFORE_COMMA-->
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=Java:SPACE_BEFORE_COMMA
+        由于IDEA只有一个SPACE_BEFORE_COMMA选项,所以统一设置 insert_space_before_comma 为 do not insert
+        -->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments"
+                 value="do not insert"/>
+
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations"
+                 value="do not insert"/>
+        <!--insert_space_before_comma end-->
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=Java:SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
+        <!--IDEA只有一个配置项SPACE_AFTER_COMMA,insert_space_after_comma*统一设置成insert-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
+        <!--insert_space_after_comma end-->
+
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=Java:SPACE_BEFORE_COLON-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=Java:SPACE_AFTER_COLON-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
+
+        <!--IDEA不支持配置,默认do not insert-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
+        <!--这个在Eclipse也没有找到配置的地方-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="do not insert"/>
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_semicolon=Java:SPACE_BEFORE_SEMICOLON
+        程序导入的时候强制将SPACE_BEFORE_SEMICOLON设置为false
+        -->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
+
+        <!--SPACE_AFTER_SEMICOLON=true-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
+
+        <!--IDEA不支持配置,do not insert-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant"
+                 value="do not insert"/>
+        <setting
+                id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration"
+                value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration"
+                 value="do not insert"/>
+
+        <!--IDEA不支持,使用默认-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=Java:<Programmatic>-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
+
+        <!--IDEA不支持配置,使用如下值,两者对应-->
+        <setting
+                id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference"
+                value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters"
+                 value="do not insert"/>
+
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters"
+                 value="insert"/>
+        <setting
+                id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference"
+                value="do not insert"/>
+
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments"
+                 value="do not insert"/>
+        <setting
+                id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference"
+                value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters"
+                 value="do not insert"/>
+
+        <!--Java:SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETER-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters"
+                 value="do not insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=Java:SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENT-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments"
+                 value="do not insert"/>
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=Java:<Programmatic>-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
+
+        <!--IDEA使用了对应的配置:Java:SPACE_WITHIN_ARRAY_INITIALIZER_BRACES,但感觉不太好,IDEA默认不插入,Eclipse也使用不插入-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer"
+                 value="do not insert"/>
+
+        <!--use default insert-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return"
+                 value="insert"/>
+
+        <!--use default do not insert -->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
+
+
+        <!--use default insert-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration"
+                 value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw"
+                 value="insert"/>
+
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=Java:SPACE_BEFORE_SWITCH_LBRACE-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=Java:SPACE_BEFORE_CLASS_LBRACE-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration"
+                 value="insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=Java:<Programmatic>-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=Java:SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"
+                 value="insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=Java:SPACE_BEFORE_METHOD_LBRACE-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration"
+                 value="insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=Java:SPACE_AFTER_QUEST-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=Java:SPACE_BEFORE_QUEST-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=Java:SPACE_BEFORE_ANOTATION_PARAMETER_LIST-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation"
+                 value="do not insert"/>
+
+        <!--use default do not insert-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
+        <setting
+                id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration"
+                value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression"
+                 value="do not insert"/>
+
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference"
+                 value="do not insert"/>
+
+
+        <!--下面两个对应IDEA中的一个配置Java:SPACE_AROUND_ASSIGNMENT_OPERATORS,使用insert-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=Java:SPACE_BEFORE_CATCH_PARENTHESES-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=Java:SPACE_BEFORE_METHOD_CALL_PARENTHESES-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation"
+                 value="do not insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=Java:SPACE_BEFORE_TRY_PARENTHESES-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
+
+        <!--下面两个对应IDEA中的一个配置Java:SPACE_AROUND_UNARY_OPERATOR,使用do not insert-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=Java:SPACE_BEFORE_IF_PARENTHESES-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=Java:SPACE_BEFORE_WHILE_PARENTHESES-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=Java:SPACE_AFTER_TYPE_CAST-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=Java:SPACE_BEFORE_METHOD_PARENTHESES-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration"
+                 value="do not insert"/>
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=Java:SPACE_BEFORE_FOR_PARENTHESES-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=Java:SPACE_BEFORE_SYNCHRONIZED_PARENTHESES-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
+
+        <!--org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=Java:SPACE_BEFORE_SWITCH_PARENTHESES-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+
+        <!--下面两个对应IDEA中的一个配置Java:SPACE_AROUND_LAMBDA_ARROW,使用insert-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
+        <!--SPACE_WITHIN_EMPTY_ARRAY_INITIALIZER_BRACES-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer"
+                 value="do not insert"/>
+
+        <!--Idea -> Wrapping And Braces -> Simple classes in one line -->
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="do not insert"/>
+        <!--Idea -> Wrapping And Braces -> Simple method in one line -->
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="do not insert"/>
+        <!--因为Idea不支持配置,所以设置为 Idea默认值-->
+
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant"
+                 value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="insert"/>
+        <!--Idea可以通过Wrap Always实现 TODO-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
+        <!--Idea -> Wrapping And Braces -> Simple block in one line -> do not select -->
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
+
+        <!--Idea -> Wrapping And Braces -> try statement -> catch.... (Java:CATCH_ON_NEW_LINE)-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement"
+                 value="do not insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=<Programmatic>-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=Java:ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer"
+                 value="do not insert"/>
+        <!--#org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=Java:ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer"
+                 value="do not insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=Java:ELSE_ON_NEW_LINE-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=Java:WHILE_ON_NEW_LINE-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement"
+                 value="do not insert"/>
+        <!--org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=Java:FINALLY_ON_NEW_LINE-->
+        <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement"
+                 value="do not insert"/>
+
+        <!--comment start-->
+        <setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="140"/>
+        <!--ENABLE_JAVADOC_FORMATTING-->
+        <setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
+        <!--org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=<Programmatic>-->
+        <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
+        <!--IDEA无对应设置,所以关闭对block comment的格式化 -->
+        <setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/>
+        <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
+        <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
+
+        <!--org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=Java:KEEP_FIRST_COLUMN_COMMENT-->
+        <setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
+        <!--org.eclipse.jdt.core.formatter.use_on_off_tags=FORMATTER_TAGS_ENABLED-->
+        <setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
+        <!--org.eclipse.jdt.core.formatter.disabling_tag=FORMATTER_OFF_TAG-->
+        <setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
+        <!--org.eclipse.jdt.core.formatter.enabling_tag=FORMATTER_ON_TAG-->
+        <setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
+
+        <!--下面的没有IDEA对应项,在代码里面对IDEA中使用默认值即可,LINE_COMMENT_AT_FIRST_COLUMN BLOCK_COMMENT_AT_FIRST_COLUMN设置为false-->
+        <setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
+        <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
+        <setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
+
+        <setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments"
+                 value="false"/>
+
+
+        <setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
+
+        <setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
+
+        <setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
+        <!--和IDEA保持一致,注释换行-->
+        <setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
+
+
+        <!--comment end-->
+
+        <!--org.eclipse.jdt.core.formatter.blank_lines_after_imports=Java:BLANK_LINES_AFTER_IMPORTS-->
+        <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
+        <!--org.eclipse.jdt.core.formatter.blank_lines_before_imports=Java:BLANK_LINES_BEFORE_IMPORTS-->
+        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
+        <!--org.eclipse.jdt.core.formatter.blank_lines_after_package=Java:BLANK_LINES_AFTER_PACKAGE-->
+        <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
+        <!--org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=Java:BLANK_LINES_AROUND_CLASS-->
+        <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
+        <!--org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=Java:BLANK_LINES_BEFORE_METHOD_BODY-->
+        <setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
+        <!--org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=Java:<Programmatic>-->
+        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
+        <!--org.eclipse.jdt.core.formatter.blank_lines_before_field=Java:BLANK_LINES_AROUND_FIELD-->
+        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
+        <!--org.eclipse.jdt.core.formatter.blank_lines_before_method=Java:BLANK_LINES_AROUND_METHOD-->
+        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
+        <!--org.eclipse.jdt.core.formatter.blank_lines_before_package=Java:BLANK_LINES_BEFORE_PACKAGE-->
+        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
+
+        <!--下面IDEA没有对应设置,使用对应值即可-->
+        <setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
+        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
+        <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
+        <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
+
+        <!--org.eclipse.jdt.core.formatter.indentation.size=Java:IndentOptions:INDENT_SIZE-->
+        <setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
+        <!--org.eclipse.jdt.core.formatter.continuation_indentation=Java:IndentOptions:<Programmatic>-->
+        <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1"/>
+        <!--org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=Java:<Programmatic>-->
+        <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
+        <!--org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=Java:IndentOptions:SMART_TABS-->
+        <setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
+        <!--org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=Java:INDENT_CASE_FROM_SWITCH-->
+        <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
+        <!--KEEP_INDENTS_ON_EMPTY_LINES-->
+        <setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
+        <!--org.eclipse.jdt.core.formatter.tabulation.size=Java:IndentOptions:<Programmatic>-->
+        <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
+        <!--Java:IndentOptions:<Programmatic>-->
+        <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
+
+
+        <!--下面IDEA没有对应设置,使用对应值即可-->
+        <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header"
+                 value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="1"/>
+
+        <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header"
+                 value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header"
+                 value="true"/>
+
+
+        <!--Java:<Programmatic>-->
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
+
+        <!--下面没有对应的IDEA设置,Eclipse先使用对应值-->
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="16"/>
+
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
+
+
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
+
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression"
+                 value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="16"/>
+
+        <!--IDEA默认配置在同一行,Eclipse使用对应值即可-->
+        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
+        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
+        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
+        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration"
+                 value="common_lines"/>
+        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
+        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
+        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
+        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
+        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
+        <setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>
+
+        <!--Java:BINARY_OPERATION_SIGN_ON_NEXT_LINE-->
+        <setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
+
+        <!--ASSIGNMENT_WRAP 需要设置为 WRAP_AS_NEEDED  WRAP_AS_NEEDED . Add in jdt.core-3.12,it's not work in previous version -->
+        <setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
+
+        <!--IDEA无配置项,Eclipse使用对应值即可-->
+        <setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
+        <setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
+        <setting id="org.eclipse.jdt.core.formatter.align_selector_in_method_invocation_on_expression_first_line" value="false"/>
+        <setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/>
+        <setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
+        <setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
+
+        <!--org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=Java:KEEP_CONTROL_STATEMENT_IN_ONE_LINE-->
+        <setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
+        <!--org.eclipse.jdt.core.formatter.compact_else_if=Java:SPECIAL_ELSE_IF_TREATMENT-->
+        <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
+        <!--Java:ALIGN_GROUP_FIELD_DECLARATIONS-->
+        <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
+        <!--Java:<Programmatic>-->
+        <setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
+        <setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
+
+        <!--统一为end_of_lint,IDEA默认一致-->
+        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
+        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
+        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
+        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
+        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
+        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
+        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
+        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration"
+                 value="end_of_line"/>
+        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
+        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
+
+
+        <!--        <setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>
+                <setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/>
+                <setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
+                        <setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
+                                <setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
+                                        <setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
+                -->
+        <!--Java:KEEP_SIMPLE_BLOCKS_IN_ONE_LINE-->
+        <setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
+
+        <!--Java:CLASS_BRACE_STYLE,统一使用end_of_line TODO-->
+        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
+        <setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
+
+        <!--org.eclipse.jdt.core.formatter.lineSplit=RIGHT_MARGIN-->
+        <setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
+
+    </profile>
+</profiles>

+ 9 - 0
.style/suppressions.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<!DOCTYPE suppressions PUBLIC
+        "-//Puppy Crawl//DTD Suppressions 1.1//EN"
+        "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
+<suppressions>
+    <!-- 忽略所有资源目录下的文件 -->
+    <suppress files=".*[/\\]resources[/\\].*" checks=".*"/>
+    <suppress files="[/\\]yaoyicloud[/\\]message[/\\]" checks=".*" />
+</suppressions>

+ 8 - 0
README.md

@@ -0,0 +1,8 @@
+test pipeline
+
+basic structure from alibaba examples.
+
+each mvn profile updates named CloudFlow in Ali Cloud.
+
+update.list defines which FC should be updated online
+

+ 129 - 0
java11-blank-http/README.md

@@ -0,0 +1,129 @@
+# java11 HTTP 回调示例程序
+本示例为您展示了 Java runtime 的 HTTP 回调示例程序。
+
+
+## 准备开始
+- [可选] 安装并配置 Serverless Devs 工具。(https://help.aliyun.com/document_detail/195474.html)
+
+## 快速开始
+### 方式一、使用 Serverless Devs 工具编译部署
+
+#### 1. 修改 s.yaml 配置
+- 根据需要修改 access 配置
+- 根据需要修改 customDomain 自定义域名配置
+
+> 注意:如果 domainName 设置为 auto,系统会默认分配测试域名,该域名仅供测试使用,不对其稳定性等做保证
+> 详细信息见:https://www.serverless-devs.com/fc/yaml/customDomains
+
+#### 2. 安装依赖并部署
+
+编译部署代码包
+```shell
+s deploy
+```
+> 注意: `pom.xml` 中有配置 `pre-deploy` 脚本 `mvn package`, 在部署前会调用 `mvn package` 编译打包。
+
+#### 3. 调用测试
+
+3.1. 使用 `s invoke` 测试
+```shell
+s invoke
+```
+
+调用函数时收到的响应如下所示(实际IP信息已隐藏):
+
+```bash
+Request url: http://xxxxxxxx.cn-hangzhou.fc.aliyuncs.com/2016-08-15/proxy/fc-example/java11-blank-http/
+========= FC invoke Logs begin =========
+FC Invoke Start RequestId: c0eb0603-4c24-4072-a773-xxxxxxxx
+FC Invoke End RequestId: c0eb0603-4c24-4072-a773-xxxxxxxx
+
+Duration: 412.83 ms, Billed Duration: 413 ms, Memory Size: 128 MB, Max Memory Used: 100.89 MB
+========= FC invoke Logs end =========
+
+FC Invoke Result[Code: 200]:
+Path: 
+ Uri: /2016-08-15/proxy/fc-example/java11-blank-http/
+ IP: xx.xx.xx.xx
+```
+
+3.2. 使用自定义域名测试
+可直接使用curl测试,或者使用API测试工具(如postman)
+
+```bash
+# 注意:将 {FunctionName},{ServiceName}和{AccountID} 替换成实际的配置
+curl -H 'X-Fc-Log-Type: Tail' -i 'http://{FunctionName}.{ServiceName}.{AccountID}.cn-hangzhou.fc.devsapp.net'
+```
+
+收到响应如下所示(实际IP信息已隐藏)
+```bash
+HTTP/1.1 200 OK
+Access-Control-Expose-Headers: Date,x-fc-request-id,x-fc-error-type,x-fc-code-checksum,x-fc-invocation-duration,x-fc-max-memory-usage,x-fc-log-result,x-fc-invocation-code-version
+Content-Type: text/plain
+Header1: value1
+Header2: value2
+X-Fc-Code-Checksum: 1786997735xxxxxxxx
+X-Fc-Instance-Id: c-624fd56e-xxxxxxxxxx
+X-Fc-Invocation-Duration: 4
+X-Fc-Invocation-Service-Version: LATEST
+X-Fc-Log-Result: RkMgSW52b2tlIFN0YXJ0IFJlcXVlc3RJZDogYzViYzI3MGUtMjI1OC00Y2FkLThmMWEtOTlmY2YxNjBkMzRhCkZDIEludm9rZSBFbmQgUmVxdWVzdElkOiBjNWJjMjcwZS0yMjU4LTRjYWQtOGYxYS05OWZjZjE2MGQzNGEKCkR1cmF0aW9uOiAzLjg3IG1zLCBCaWxsZWQgRHVyYXRpb246IDQgbXMsIE1lbW9yeSBTaXplOiAxMjggTUIsIE1heCBNZW1vcnkgVXNlZDogMTAwLjI2IE1C
+X-Fc-Max-Memory-Usage: 100.26
+X-Fc-Request-Id: c5bc270e-2258-4cad-8f1a-99fcf160d34a
+Date: Fri, 08 Apr 2022 06:28:49 GMT
+Content-Length: 34
+
+Path: 
+ Uri: /
+ IP: xxx.xxx.xxx.xxx
+```
+
+返回Header中的 `X-Fc-Log-Result` 是base64编码的日志,可以在命令下使用`base64`解码
+```bash
+$ echo RkMgSW52b2tlIFN0YXJ0IFJlcXVlc3RJZDogYzViYzI3MGUtMjI1OC00Y2FkLThmMWEtOTlmY2YxNjBkMzRhCkZDIEludm9rZSBFbmQgUmVxdWVzdElkOiBjNWJjMjcwZS0yMjU4LTRjYWQtOGYxYS05OWZjZjE2MGQzNGEKCkR1cmF0aW9uOiAzLjg3IG1zLCBCaWxsZWQgRHVyYXRpb246IDQgbXMsIE1lbW9yeSBTaXplOiAxMjggTUIsIE1heCBNZW1vcnkgVXNlZDogMTAwLjI2IE1C | base64 -d
+```
+
+可以看到以下输出:
+```bash
+FC Invoke Start RequestId: c5bc270e-2258-4cad-8f1a-99fcf160d34a
+FC Invoke End RequestId: c5bc270e-2258-4cad-8f1a-99fcf160d34a
+
+Duration: 3.87 ms, Billed Duration: 4 ms, Memory Size: 128 MB, Max Memory Used: 100.26 MB
+```
+
+### 方式二、使用控制台创建
+
+#### 1. 编译打包
+
+```shell
+# 编译部署
+mvn package
+# 打包文件
+cd target && zip -r java11-blank-http.zip *
+```
+
+#### 2. 创建函数
+选择服务(或创建服务)后,单击创建函数,如图所示
+- 选择 `从零开始创建`
+- 填入函数名称
+- 选择运行环境 java11/java8
+- 选择函数触发方式:通过HTTP请求触发
+- 其他设置使用默认
+
+![img_1.png](assets/20220408141134.jpg)
+
+> 详细创建函数流程见文档: [使用控制台创建函数](https://help.aliyun.com/document_detail/51783.html)
+
+
+#### 3. 配置测试参数
+在函数管理页面的测试函数标签栏配置测试参数
+
+![img_2.png](assets/20220408143909.jpg)
+
+#### 4. 测试函数
+
+返回结果如下所示(实际IP信息已隐藏)
+```bash
+Path: 
+ Uri: /2016-08-15/proxy/fc-example.LATEST/java11-blank-http/
+ IP: xxx.xxx.xxx.xxx
+```

BIN
java11-blank-http/assets/20220408141134.jpg


BIN
java11-blank-http/assets/20220408143909.jpg


+ 49 - 0
java11-blank-http/dependency-reduced-pom.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>java11-blank-http</artifactId>
+  <name>HelloFCJava</name>
+  <version>1.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <filters>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <properties>
+    <maven.compiler.target>1.11</maven.compiler.target>
+    <maven.test.skip>true</maven.test.skip>
+    <maven.compiler.source>1.11</maven.compiler.source>
+  </properties>
+</project>

+ 59 - 0
java11-blank-http/pom.xml

@@ -0,0 +1,59 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>java11-blank-http</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>HelloFCJava</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun.fc.runtime</groupId>
+      <artifactId>fc-java-core</artifactId>
+      <version>1.3.0</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-shade-plugin</artifactId>
+          <version>3.2.1</version>
+          <executions>
+            <execution>
+              <phase>package</phase>
+              <goals>
+                <goal>shade</goal>
+              </goals>
+              <configuration>
+                <filters>
+                  <filter>
+                    <artifact>*:*</artifact>
+                    <excludes>
+                      <exclude>META-INF/*.SF</exclude>
+                      <exclude>META-INF/*.DSA</exclude>
+                      <exclude>META-INF/*.RSA</exclude>
+                    </excludes>
+                  </filter>
+                </filters>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <maven.compiler.target>11</maven.compiler.target>
+    <maven.compiler.source>11</maven.compiler.source>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+</project>

+ 57 - 0
java11-blank-http/readme_s.md

@@ -0,0 +1,57 @@
+# 阿里云函数计算 Java8 HTTP 函数案例
+
+<toc>
+
+<p align="center"><b> 中文 | <a href="./readme_en.md"> English </a>  </b></p>
+
+- [快速开始](#快速开始)
+    - [通过应用中心部署](#通过应用中心部署)
+    - [通过命令行工具部署](#通过命令行工具部署)
+    - [通过阿里云CloudShell部署](#通过阿里云CloudShell部署)
+- [应用详情](#应用详情)
+- [关于我们](#关于我们)
+
+</toc>
+
+# 快速开始
+
+- [:octocat: 源代码](https://github.com/devsapp/start-fc/tree/master/http-function/fc-http-java8/src)
+
+## 通过应用中心部署
+
+<appcenter>
+
+您可以在阿里云 [:earth_asia: Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-fc-http-java8) ,快速体验该应用:   
+
+[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-fc-http-java8) 
+
+</appcenter>
+
+## 通过命令行工具部署
+
+> 在开始之前,需要先安装 Serverless Devs 开发者工具:`npm install @serverless-devs/s -g`,更多安装方法,可以参考[Serverless Devs 安装文档](https://www.serverless-devs.com/serverless-devs/install) ,针对阿里云还需要配置密钥信息,配置密钥信息的方法可以参考[阿里云密钥配置文档](https://www.serverless-devs.com/fc/config)
+
+- 初始化项目:`s init start-fc-http-java8 -d start-fc-http-java8`    
+    > 涉及到确定密钥的选择、服务名称的确定、函数名称的确定以及容器镜像的确定    
+- 进入项目:`cd start-fc-http-java8`
+- 部署项目:`s deploy -y`
+- 调用函数:直接使用 POST 或者 GET 方法 curl 部署项目时候生成自定义域名
+
+## 通过阿里云CloudShell部署
+
+如果您不想在应用中心中快速体验,也不想下载命令行工具体验,您也可以在[ :rocket:  阿里云 CloudShell](https://api.aliyun.com/new#/tutorial?action=git_open&git_repo=https://github.com/devsapp/start-fc.git&tutorial=http-function/fc-http-java8/cloudshell.md) 中快速体验。
+
+# 应用详情
+
+本应用仅作为学习和参考使用,您可以基于本项目进行二次开发和完善,实现自己的业务逻辑
+
+# 关于我们
+
+- Serverless Devs 工具:
+    - 仓库:[https://www.github.com/serverless-devs/serverless-devs](https://www.github.com/serverless-devs/serverless-devs)    
+      > 欢迎帮我们增加一个 :star2: 
+    - 官网:[https://www.serverless-devs.com/](https://www.serverless-devs.com/)
+- 阿里云函数计算组件:
+    - 仓库:[https://github.com/devsapp/fc](https://github.com/devsapp/fc)
+    - 帮助文档:[https://www.serverless-devs.com/fc/readme](https://www.serverless-devs.com/fc/readme)
+- 钉钉交流群:33947367    

+ 41 - 0
java11-blank-http/readme_s_en.md

@@ -0,0 +1,41 @@
+# Alibaba Cloud Function Compute Java8 HTTP function case
+
+<toc>
+
+<p align="center"><b> <a href="./readme.md"> 中文 </a> | English </b></p>
+
+- [Quick start](#Quick-start)
+    - [Deploy via command line tool](#Deploy-via-command-line-tools)
+- [Application details](#Application-details)
+- [About Us](#About-Us)
+
+</toc>
+
+# Quick start
+
+- [:octocat: source](https://github.com/devsapp/start-fc/tree/master/http-function/fc-http-java8/src)
+
+## Deploy via command line tools
+
+> Before starting, you need to install the Serverless Devs developer tools: `npm install @serverless-devs/s -g`, for more installation methods, please refer to [Serverless Devs Installation Documentation](https://www.serverless-devs.com/serverless-devs/install) , you also need to configure key information for Alibaba Cloud. For the method of configuring key information, please refer to [Alibaba Cloud Key Configuration Document](https://www.serverless-devs.com/fc/config)
+
+- Initialize the project: `s init start-fc-http-java8 -d start-fc-http-java8`
+    > It involves determining the selection of the key, the determination of the service name, the determination of the function name, and the determination of the container image
+- Enter the project: `cd start-fc-http-java8`
+- Deploy the project: `s deploy -y`
+- Invoke function: Directly use POST or GET method curl to the custom domain name that is generated when deploying the project
+
+# Application details
+
+This application is only used for learning and reference. You can carry out secondary development and improvement based on this project to realize your own business logic.
+
+# About Us
+
+- Serverless Devs Tools:
+    - Repository: [https://www.github.com/serverless-devs/serverless-devs](https://www.github.com/serverless-devs/serverless-devs)
+      > Welcome to add a :star2:
+    - Official website: [https://www.serverless-devs.com/](https://www.serverless-devs.com/)
+- Alibaba Cloud Function Compute components:
+    - Repository: [https://github.com/devsapp/fc](https://github.com/devsapp/fc)
+    - Help document: [https://www.serverless-devs.com/fc/readme](https://www.serverless-devs.com/fc/readme)
+- Dingding communication group: 33947367

+ 75 - 0
java11-blank-http/s.yaml

@@ -0,0 +1,75 @@
+# ------------------------------------
+#   If you need English case, you can refer to [s_en.yaml] file
+# ------------------------------------
+#   欢迎您使用阿里云函数计算 FC 组件进行项目开发
+#   组件仓库地址:https://github.com/devsapp/fc
+#   组件帮助文档:https://www.serverless-devs.com/fc/readme
+#   Yaml参考文档:https://www.serverless-devs.com/fc/yaml/readme
+#   关于:
+#      - Serverless Devs和FC组件的关系、如何声明/部署多个函数、超过50M的代码包如何部署
+#      - 关于.fcignore使用方法、工具中.s目录是做什么、函数进行build操作之后如何处理build的产物
+#   等问题,可以参考文档:https://www.serverless-devs.com/fc/tips
+#   关于如何做CICD等问题,可以参考:https://www.serverless-devs.com/serverless-devs/cicd
+#   关于如何进行环境划分等问题,可以参考:https://www.serverless-devs.com/serverless-devs/extend
+#   更多函数计算案例,可参考:https://github.com/devsapp/awesome/
+#   有问题快来钉钉群问一下吧:33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access 是当前应用所需要的密钥信息配置:
+# 密钥配置可以参考:https://www.serverless-devs.com/serverless-devs/command/config
+# 密钥使用顺序可以参考:https://www.serverless-devs.com/serverless-devs/tool#密钥使用顺序与规范
+access: default
+
+vars: # 全局变量
+  region: cn-hangzhou
+  service:
+    name: fc-example
+    description: 'fc example by serverless devs'
+
+services:
+  helloworld: # 业务名称/模块名称
+    # 如果只想针对 helloworld 下面的业务进行相关操作,可以在命令行中加上 helloworld,例如:
+    # 只对helloworld进行构建:s helloworld build
+    # 如果不带有 helloworld ,而是直接执行 s build,工具则会对当前Yaml下,所有和 helloworld 平级的业务模块(如有其他平级的模块,例如下面注释的next-function),按照一定顺序进行 build 操作
+    component: fc # 组件名称,Serverless Devs 工具本身类似于一种游戏机,不具备具体的业务能力,组件类似于游戏卡,用户通过向游戏机中插入不同的游戏卡实现不同的功能,即通过使用不同的组件实现不同的具体业务能力
+    actions: # 自定义执行逻辑,关于actions 的使用,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#行为描述
+      pre-deploy: # 在deploy之前运行
+        - run: mvn package
+          path: ./
+    #        - component: fc build --use-docker --dockerfile ./code/Dockerfile  # 要运行的组件,格式为【component: 组件名 命令 参数】(可以通过s cli registry search --type Component 获取组件列表)
+    #        - run: docker build xxx          # 要执行的系统命令,类似于一种钩子的形式
+    #          path: ./src                    # 执行系统命令/钩子的路径
+    #        - plugin: myplugin               # 与运行的插件 (可以通过s cli registry search --type Plugin 获取组件列表)
+    #          args:                          # 插件的参数信息
+    #            testKey: testValue
+    #      post-deploy: # 在deploy之后运行
+    #        - component: fc versions publish # 要运行的命令行
+    props:
+      region: ${vars.region} # 关于变量的使用方法,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#变量赋值
+      service: ${vars.service}
+      function:
+        name: java11-blank-http
+        description: 'fc example by serverless devs'
+        runtime: java11
+        codeUri: ./target
+        handler: example.App::handleRequest
+        memorySize: 128
+        timeout: 60
+        # initializationTimeout: 60
+        # initializer: example.App::initialize
+      triggers:
+        - name: httpTrigger
+          type: http
+          config:
+            authType: anonymous
+            methods:
+              - GET
+      customDomains:
+        - domainName: auto
+          protocol: HTTP
+          routeConfigs:
+            - path: /*
+              methods:
+                - GET
+                - POST

+ 89 - 0
java11-blank-http/s_en.yaml

@@ -0,0 +1,89 @@
+# ------------------------------------
+#   If you want to use this file directly, please add [-t/--template] parameter, for example [s deploy -t s_en.yaml]
+# ------------------------------------
+#   Welcome to use Alibaba Cloud Function Compute FC components for project development
+#   Component warehouse address: https://github.com/devsapp/fc
+#   Component help documentation: https://www.serverless-devs.com/fc/readme
+#   Yaml reference documentation: https://www.serverless-devs.com/fc/yaml/readme
+#   About:
+#     - The relationship between Serverless Devs and FC components, how to declare/deploy multiple functions, how to deploy code packages over 50M
+#     - About the usage of .fcignore, what the .s directory in the tool does, and how to process the build product after the function performs the build operation
+#   and other issues, you can refer to the documentation: https://www.serverless-devs.com/fc/tips
+#   For questions about how to do CICD, please refer to: https://www.serverless-devs.com/serverless-devs/cicd
+#   For issues such as how to divide the environment, please refer to: https://www.serverless-devs.com/serverless-devs/extend
+#   For more function calculation cases, please refer to: https://github.com/devsapp/awesome/blob/main/README_en.md
+#   If you have any questions, please come to the DingTalk group and ask: 33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access is the key information configuration required by the current application:
+# Key configuration can refer to: https://www.serverless-devs.com/serverless-devs/command/config
+# For the order of key usage, please refer to: https://www.serverless-devs.com/serverless-devs/tool#Key usage order and specification
+# access: "{{ access }}"
+
+vars: # global variables
+  region: cn-hangzhou
+  service:
+    name: hello-world-service
+    description: 'hello world by serverless devs'
+
+services:
+  helloworld: # business name/module name
+    # If you only want to perform related operations on the business below helloworld, you can add helloworld to the command line, for example:
+    # Build only helloworld: s helloworld build
+    # If s build is directly executed without helloworld, the tool will perform the same operation on all business modules at the same level as helloworld under the current Yaml (if there are other level modules, such as the next-function commented below), according to certain Sequential build operations
+    component: fc    # The name of the component. The Serverless Devs tool itself is similar to a game console and does not have specific business capabilities. The component is similar to a game card. Users can achieve different functions by inserting different game cards into the game console, that is, by using Different components implement different specific business capabilities
+    actions:         # Customize execution logic. For the use of actions, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Behavior description
+      pre-deploy:    # run before deploy
+        - run: mvn package
+          path: ./
+#        - component: fc build --use-docker --dockerfile ./code/Dockerfile # The component to run, the format is [component: component name command parameter] (you can get the component list through s cli registry search --type Component)
+#        - run: docker build xxx                  # System command to execute, similar to a hook
+#          path: ./src                            # The path to execute system commands/hooks
+#        - plugin: myplugin                       # and running plugins (you can get a list of components via s cli registry search --type Plugin)
+#          args:                                  # parameter information of the plugin
+#            testKey: testValue
+#      post-deploy:                               # run after deploy
+#        - component: fc versions publish         # command line to run
+    props:
+      region: ${vars.region} # For the usage of variables, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Variable assignment
+      service: ${vars.service}
+      function:
+        name: custom-cpp-event-function
+        description: 'hello world by serverless devs'
+        runtime: java8
+        codeUri: ./target
+        handler: example.App::handleRequest
+        memorySize: 128
+        timeout: 60
+        initializationTimeout: 60
+        initializer: example.App::initialize
+      triggers:
+        - name: httpTrigger
+          type: http
+          config:
+            authType: anonymous
+            methods:
+              - GET
+      customDomains:
+        - domainName: auto
+          protocol: HTTP
+          routeConfigs:
+            - path: /*
+              methods:
+                - GET
+                - POST
+#  next-function: # The case of the second function, just for reference
+#    # If you execute s deploy under the current project, the modules will be deployed at the same time:
+#    #   helloworld: service hello-world-service, function cpp-event-function
+#    #   next-function: service hello-world-service, function next-function-example
+#    # If you want to deploy the current service and function separately, you can execute s + module name/business name + deploy, for example: s next-function deploy
+#    # If you want to deploy the current function separately, you can execute s + module name/business name + deploy function, for example: s next-function deploy function
+#    # For more commands, please refer to: https://www.serverless-devs.com/fc/readme#Document related
+#    component: fc
+#    props:
+#      region: ${vars.region}
+#      service: ${vars.service} # The overall service configuration of the application
+#      function: # define a new function
+#        name: next-function-example
+#        description: 'hello world by serverless devs'

+ 33 - 0
java11-blank-http/src/main/java/example/App.java

@@ -0,0 +1,33 @@
+package example;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import javax.servlet.ServletException;
+
+import com.aliyun.fc.runtime.Context;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import com.aliyun.fc.runtime.HttpRequestHandler;
+
+public class App implements HttpRequestHandler {
+
+	@Override
+	public void handleRequest(HttpServletRequest request, HttpServletResponse response, Context context)
+			throws IOException, ServletException {
+		String requestPath = (String) request.getAttribute("FC_REQUEST_PATH");
+		String requestURI = (String) request.getAttribute("FC_REQUEST_URI");
+		String requestClientIP = (String) request.getAttribute("FC_REQUEST_CLIENT_IP");
+
+		response.setStatus(200);
+		response.setHeader("header1", "value1");
+		response.setHeader("header2", "value2");
+		response.setHeader("Content-Type", "text/plain");
+
+		String body = String.format("Path: %s\n Uri: %s\n IP: %s\n", requestPath, requestURI, requestClientIP);
+		OutputStream out = response.getOutputStream();
+		out.write((body).getBytes());
+		out.flush();
+		out.close();
+	}
+
+}

BIN
java11-blank-http/target/classes/example/App.class


+ 1 - 0
java11-blank-http/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1 @@
+example/App.class

+ 1 - 0
java11-blank-http/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1 @@
+/Users/jackd/dev/ai/test-pipeline/java11-blank-http/src/main/java/example/App.java

+ 84 - 0
java11-blank-pojo-event/README.md

@@ -0,0 +1,84 @@
+# java11 POJO 事件回调示例程序
+本示例为您展示了 Java runtime 的 POJO 事件回调示例程序。
+
+
+## 准备开始
+- [可选] 安装并配置 Serverless Devs 工具。(https://help.aliyun.com/document_detail/195474.html)
+
+## 快速开始
+### 方式一、使用 Serverless Devs 工具编译部署
+
+#### 1. 修改 s.yaml 配置
+- 根据需要修改 access 配置
+
+#### 2. 安装依赖并部署
+
+编译部署代码包
+```shell
+s deploy
+```
+> 注意: `pom.xml` 中有配置 `pre-deploy` 脚本 `mvn package`, 在部署前会调用 `mvn package` 编译打包。
+
+#### 3. 调用测试
+
+```shell
+s invoke --event-file event.json
+```
+
+调用函数时收到的响应如下所示:
+
+```bash
+
+Reading event file content:
+{
+  "firstName": "FC",
+  "lastName": "aliyun"
+}
+========= FC invoke Logs begin =========
+FC Invoke Start RequestId: fa3e5ad1-55dd-48ad-9d28-xxxxxxxxx
+FC Invoke End RequestId: fa3e5ad1-55dd-48ad-9d28-xxxxxxxxx
+
+Duration: 311.60 ms, Billed Duration: 312 ms, Memory Size: 128 MB, Max Memory Used: 97.50 MB
+========= FC invoke Logs end =========
+
+FC Invoke Result:
+{"message":"Hello, FC aliyun"}
+
+
+End of method: invoke
+```
+
+### 方式二、使用控制台创建
+
+#### 1. 编译打包
+```shell
+# 编译部署
+mvn package
+# 打包文件
+cd target && zip -r java11-pojo-event-blank.zip *
+```
+#### 2. 创建函数
+选择服务(或创建服务)后,单击创建函数,如图所示
+- 选择 `从零开始创建`
+- 填入函数名称
+- 选择运行环境 java11/java8
+- 选择函数触发方式:通过事件请求触发
+- [请求处理程序](https://help.aliyun.com/document_detail/432663.html)(函数入口)设为:example.PojoHandler::handleRequest
+- 其他设置使用默认
+
+![img_1.png](assets/20220608155705.jpg)
+
+> 详细创建函数流程见文档: [使用控制台创建函数](hhttps://help.aliyun.com/document_detail/51783.html)
+
+
+#### 3. 配置测试参数
+在函数管理页面的测试函数标签栏配置测试参数
+
+![img_2.png](assets/20220608155906.jpg)
+
+#### 4. 测试函数
+
+返回结果如下所示
+```bash
+{"message":"Hello, FC aliyun"}
+```

BIN
java11-blank-pojo-event/assets/20220608155705.jpg


BIN
java11-blank-pojo-event/assets/20220608155906.jpg


+ 49 - 0
java11-blank-pojo-event/dependency-reduced-pom.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>java11-blank-pojo-event</artifactId>
+  <name>HelloFCJava</name>
+  <version>1.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <filters>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <properties>
+    <maven.compiler.target>1.11</maven.compiler.target>
+    <maven.test.skip>true</maven.test.skip>
+    <maven.compiler.source>1.11</maven.compiler.source>
+  </properties>
+</project>

+ 4 - 0
java11-blank-pojo-event/event.json

@@ -0,0 +1,4 @@
+{
+  "firstName": "FC",
+  "lastName": "aliyun"
+}

+ 59 - 0
java11-blank-pojo-event/pom.xml

@@ -0,0 +1,59 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>java11-blank-pojo-event</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>HelloFCJava</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun.fc.runtime</groupId>
+      <artifactId>fc-java-core</artifactId>
+      <version>1.4.1</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-shade-plugin</artifactId>
+          <version>3.2.1</version>
+          <executions>
+            <execution>
+              <phase>package</phase>
+              <goals>
+                <goal>shade</goal>
+              </goals>
+              <configuration>
+                <filters>
+                  <filter>
+                    <artifact>*:*</artifact>
+                    <excludes>
+                      <exclude>META-INF/*.SF</exclude>
+                      <exclude>META-INF/*.DSA</exclude>
+                      <exclude>META-INF/*.RSA</exclude>
+                    </excludes>
+                  </filter>
+                </filters>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <maven.compiler.target>11</maven.compiler.target>
+    <maven.compiler.source>11</maven.compiler.source>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+</project>

+ 57 - 0
java11-blank-pojo-event/readme_s.md

@@ -0,0 +1,57 @@
+# 阿里云函数计算 Java8 Event 函数案例
+
+<toc>
+
+<p align="center"><b> 中文 | <a href="./readme_en.md"> English </a>  </b></p>
+
+- [快速开始](#快速开始)
+    - [通过应用中心部署](#通过应用中心部署)
+    - [通过命令行工具部署](#通过命令行工具部署)
+    - [通过阿里云CloudShell部署](#通过阿里云CloudShell部署)
+- [应用详情](#应用详情)
+- [关于我们](#关于我们)
+
+</toc>
+
+# 快速开始
+
+- [:octocat: 源代码](https://github.com/devsapp/start-fc/tree/master/event-function/fc-event-java8/src)
+
+## 通过应用中心部署
+
+<appcenter>
+
+您可以在阿里云 [:earth_asia: Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-fc-event-java8) ,快速体验该应用:   
+
+[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-fc-event-java8) 
+
+</appcenter>
+
+## 通过命令行工具部署
+
+> 在开始之前,需要先安装 Serverless Devs 开发者工具:`npm install @serverless-devs/s -g`,更多安装方法,可以参考[Serverless Devs 安装文档](https://www.serverless-devs.com/serverless-devs/install) ,针对阿里云还需要配置密钥信息,配置密钥信息的方法可以参考[阿里云密钥配置文档](https://www.serverless-devs.com/fc/config)
+
+- 初始化项目:`s init start-fc-event-java8 -d start-fc-event-java8`    
+    > 涉及到确定密钥的选择、服务名称的确定、函数名称的确定以及容器镜像的确定    
+- 进入项目:`cd start-fc-event-java8`
+- 部署项目:`s deploy -y`
+- 调用函数:`s invoke -e '{"key":"val"}'`
+
+## 通过阿里云CloudShell部署
+
+如果您不想在应用中心中快速体验,也不想下载命令行工具体验,您也可以在[ :rocket:  阿里云 CloudShell](https://api.aliyun.com/new#/tutorial?action=git_open&git_repo=https://github.com/devsapp/start-fc.git&tutorial=event-function/fc-event-java8/cloudshell.md) 中快速体验。
+
+# 应用详情
+
+本应用仅作为学习和参考使用,您可以基于本项目进行二次开发和完善,实现自己的业务逻辑
+
+# 关于我们
+
+- Serverless Devs 工具:
+    - 仓库:[https://www.github.com/serverless-devs/serverless-devs](https://www.github.com/serverless-devs/serverless-devs)    
+      > 欢迎帮我们增加一个 :star2: 
+    - 官网:[https://www.serverless-devs.com/](https://www.serverless-devs.com/)
+- 阿里云函数计算组件:
+    - 仓库:[https://github.com/devsapp/fc](https://github.com/devsapp/fc)
+    - 帮助文档:[https://www.serverless-devs.com/fc/readme](https://www.serverless-devs.com/fc/readme)
+- 钉钉交流群:33947367    

+ 41 - 0
java11-blank-pojo-event/readme_s_en.md

@@ -0,0 +1,41 @@
+# Alibaba Cloud Function Compute Java8 Event function case
+
+<toc>
+
+<p align="center"><b> <a href="./readme.md"> 中文 </a> | English </b></p>
+
+- [Quick start](#Quick-start)
+    - [Deploy via command line tool](#Deploy-via-command-line-tools)
+- [Application details](#Application-details)
+- [About Us](#About-Us)
+
+</toc>
+
+# Quick start
+
+- [:octocat: source](https://github.com/devsapp/start-fc/tree/master/event-function/fc-event-java8/src)
+
+## Deploy via command line tools
+
+> Before starting, you need to install the Serverless Devs developer tools: `npm install @serverless-devs/s -g`, for more installation methods, please refer to [Serverless Devs Installation Documentation](https://www.serverless-devs.com/serverless-devs/install) , you also need to configure key information for Alibaba Cloud. For the method of configuring key information, please refer to [Alibaba Cloud Key Configuration Document](https://www.serverless-devs.com/fc/config)
+
+- Initialize the project: `s init start-fc-event-java8 -d start-fc-event-java8`
+    > It involves determining the selection of the key, the determination of the service name, the determination of the function name, and the determination of the container image
+- Enter the project: `cd start-fc-event-java8`
+- Deploy the project: `s deploy -y`
+- Invoke function: `s invoke -e '{"key":"val"}'`
+
+# Application details
+
+This application is only used for learning and reference. You can carry out secondary development and improvement based on this project to realize your own business logic.
+
+# About Us
+
+- Serverless Devs Tools:
+    - Repository: [https://www.github.com/serverless-devs/serverless-devs](https://www.github.com/serverless-devs/serverless-devs)
+      > Welcome to add a :star2:
+    - Official website: [https://www.serverless-devs.com/](https://www.serverless-devs.com/)
+- Alibaba Cloud Function Compute components:
+    - Repository: [https://github.com/devsapp/fc](https://github.com/devsapp/fc)
+    - Help document: [https://www.serverless-devs.com/fc/readme](https://www.serverless-devs.com/fc/readme)
+- Dingding communication group: 33947367

+ 60 - 0
java11-blank-pojo-event/s.yaml

@@ -0,0 +1,60 @@
+# ------------------------------------
+#   If you need English case, you can refer to [s_en.yaml] file
+# ------------------------------------
+#   欢迎您使用阿里云函数计算 FC 组件进行项目开发
+#   组件仓库地址:https://github.com/devsapp/fc
+#   组件帮助文档:https://www.serverless-devs.com/fc/readme
+#   Yaml参考文档:https://www.serverless-devs.com/fc/yaml/readme
+#   关于:
+#      - Serverless Devs和FC组件的关系、如何声明/部署多个函数、超过50M的代码包如何部署
+#      - 关于.fcignore使用方法、工具中.s目录是做什么、函数进行build操作之后如何处理build的产物
+#   等问题,可以参考文档:https://www.serverless-devs.com/fc/tips
+#   关于如何做CICD等问题,可以参考:https://www.serverless-devs.com/serverless-devs/cicd
+#   关于如何进行环境划分等问题,可以参考:https://www.serverless-devs.com/serverless-devs/extend
+#   更多函数计算案例,可参考:https://github.com/devsapp/awesome/
+#   有问题快来钉钉群问一下吧:33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access 是当前应用所需要的密钥信息配置:
+# 密钥配置可以参考:https://www.serverless-devs.com/serverless-devs/command/config
+# 密钥使用顺序可以参考:https://www.serverless-devs.com/serverless-devs/tool#密钥使用顺序与规范
+access: default
+
+vars: # 全局变量
+  region: cn-hangzhou
+  service:
+    name: fc-example
+    description: 'hello world by serverless devs'
+
+services:
+  helloworld: # 业务名称/模块名称
+    # 如果只想针对 helloworld 下面的业务进行相关操作,可以在命令行中加上 helloworld,例如:
+    # 只对helloworld进行构建:s helloworld build
+    # 如果不带有 helloworld ,而是直接执行 s build,工具则会对当前Yaml下,所有和 helloworld 平级的业务模块(如有其他平级的模块,例如下面注释的next-function),按照一定顺序进行 build 操作
+    component: fc # 组件名称,Serverless Devs 工具本身类似于一种游戏机,不具备具体的业务能力,组件类似于游戏卡,用户通过向游戏机中插入不同的游戏卡实现不同的功能,即通过使用不同的组件实现不同的具体业务能力
+    actions: # 自定义执行逻辑,关于actions 的使用,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#行为描述
+      pre-deploy: # 在deploy之前运行
+        - run: mvn package
+          path: ./
+    #        - component: fc build --use-docker --dockerfile ./code/Dockerfile  # 要运行的组件,格式为【component: 组件名 命令 参数】(可以通过s cli registry search --type Component 获取组件列表)
+    #        - run: docker build xxx          # 要执行的系统命令,类似于一种钩子的形式
+    #          path: ./src                    # 执行系统命令/钩子的路径
+    #        - plugin: myplugin               # 与运行的插件 (可以通过s cli registry search --type Plugin 获取组件列表)
+    #          args:                          # 插件的参数信息
+    #            testKey: testValue
+    #      post-deploy: # 在deploy之后运行
+    #        - component: fc versions publish # 要运行的命令行
+    props:
+      region: ${vars.region} # 关于变量的使用方法,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#变量赋值
+      service: ${vars.service}
+      function:
+        name: java11-blank-pojo-event
+        description: 'hello world by serverless devs'
+        runtime: java11
+        codeUri: ./target
+        handler: example.PojoHandler::handleRequest
+        memorySize: 128
+        timeout: 60
+        # initializationTimeout: 60
+        # initializer: example.App::initialize

+ 74 - 0
java11-blank-pojo-event/s_en.yaml

@@ -0,0 +1,74 @@
+# ------------------------------------
+#   If you want to use this file directly, please add [-t/--template] parameter, for example [s deploy -t s_en.yaml]
+# ------------------------------------
+#   Welcome to use Alibaba Cloud Function Compute FC components for project development
+#   Component warehouse address: https://github.com/devsapp/fc
+#   Component help documentation: https://www.serverless-devs.com/fc/readme
+#   Yaml reference documentation: https://www.serverless-devs.com/fc/yaml/readme
+#   About:
+#     - The relationship between Serverless Devs and FC components, how to declare/deploy multiple functions, how to deploy code packages over 50M
+#     - About the usage of .fcignore, what the .s directory in the tool does, and how to process the build product after the function performs the build operation
+#   and other issues, you can refer to the documentation: https://www.serverless-devs.com/fc/tips
+#   For questions about how to do CICD, please refer to: https://www.serverless-devs.com/serverless-devs/cicd
+#   For issues such as how to divide the environment, please refer to: https://www.serverless-devs.com/serverless-devs/extend
+#   For more function calculation cases, please refer to: https://github.com/devsapp/awesome/blob/main/README_en.md
+#   If you have any questions, please come to the DingTalk group and ask: 33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access is the key information configuration required by the current application:
+# Key configuration can refer to: https://www.serverless-devs.com/serverless-devs/command/config
+# For the order of key usage, please refer to: https://www.serverless-devs.com/serverless-devs/tool#Key usage order and specification
+# access: "{{ access }}"
+
+vars: # global variables
+  region: cn-hangzhou
+  service:
+    name: hello-world-service
+    description: 'hello world by serverless devs'
+
+services:
+  helloworld: # business name/module name
+    # If you only want to perform related operations on the business below helloworld, you can add helloworld to the command line, for example:
+    # Build only helloworld: s helloworld build
+    # If s build is directly executed without helloworld, the tool will perform the same operation on all business modules at the same level as helloworld under the current Yaml (if there are other level modules, such as the next-function commented below), according to certain Sequential build operations
+    component: fc    # The name of the component. The Serverless Devs tool itself is similar to a game console and does not have specific business capabilities. The component is similar to a game card. Users can achieve different functions by inserting different game cards into the game console, that is, by using Different components implement different specific business capabilities
+    actions:         # Customize execution logic. For the use of actions, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Behavior description
+      pre-deploy:    # run before deploy
+        - run: mvn package
+          path: ./
+#        - component: fc build --use-docker --dockerfile ./code/Dockerfile # The component to run, the format is [component: component name command parameter] (you can get the component list through s cli registry search --type Component)
+#        - run: docker build xxx                  # System command to execute, similar to a hook
+#          path: ./src                            # The path to execute system commands/hooks
+#        - plugin: myplugin                       # and running plugins (you can get a list of components via s cli registry search --type Plugin)
+#          args:                                  # parameter information of the plugin
+#            testKey: testValue
+#      post-deploy:                               # run after deploy
+#        - component: fc versions publish         # command line to run
+    props:
+      region: ${vars.region} # For the usage of variables, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Variable assignment
+      service: ${vars.service}
+      function:
+        name: custom-cpp-event-function
+        description: 'hello world by serverless devs'
+        runtime: java8
+        codeUri: ./target
+        handler: example.App::handleRequest
+        memorySize: 128
+        timeout: 60
+        initializationTimeout: 60
+        initializer: example.App::initialize
+#  next-function: # The case of the second function, just for reference
+#    # If you execute s deploy under the current project, the modules will be deployed at the same time:
+#    #   helloworld: service hello-world-service, function cpp-event-function
+#    #   next-function: service hello-world-service, function next-function-example
+#    # If you want to deploy the current service and function separately, you can execute s + module name/business name + deploy, for example: s next-function deploy
+#    # If you want to deploy the current function separately, you can execute s + module name/business name + deploy function, for example: s next-function deploy function
+#    # For more commands, please refer to: https://www.serverless-devs.com/fc/readme#Document related
+#    component: fc
+#    props:
+#      region: ${vars.region}
+#      service: ${vars.service} # The overall service configuration of the application
+#      function: # define a new function
+#        name: next-function-example
+#        description: 'hello world by serverless devs'

+ 15 - 0
java11-blank-pojo-event/src/main/java/example/PojoHandler.java

@@ -0,0 +1,15 @@
+package example;
+
+import com.aliyun.fc.runtime.Context;
+import com.aliyun.fc.runtime.PojoRequestHandler;
+
+public class PojoHandler implements PojoRequestHandler<SimpleRequest, SimpleResponse> {
+
+	@Override
+	public SimpleResponse handleRequest(SimpleRequest request, Context context) {
+		String message = "Hello, " + request.getFirstName() + " " + request.getLastName();
+		System.out.println(message);
+		return new SimpleResponse(message);
+	}
+
+}

+ 33 - 0
java11-blank-pojo-event/src/main/java/example/SimpleRequest.java

@@ -0,0 +1,33 @@
+package example;
+
+public class SimpleRequest {
+
+	String firstName;
+
+	String lastName;
+
+	public String getFirstName() {
+		return firstName;
+	}
+
+	public void setFirstName(String firstName) {
+		this.firstName = firstName;
+	}
+
+	public String getLastName() {
+		return lastName;
+	}
+
+	public void setLastName(String lastName) {
+		this.lastName = lastName;
+	}
+
+	public SimpleRequest() {
+	}
+
+	public SimpleRequest(String firstName, String lastName) {
+		this.firstName = firstName;
+		this.lastName = lastName;
+	}
+
+}

+ 22 - 0
java11-blank-pojo-event/src/main/java/example/SimpleResponse.java

@@ -0,0 +1,22 @@
+package example;
+
+public class SimpleResponse {
+
+	String message;
+
+	public String getMessage() {
+		return message;
+	}
+
+	public void setMessage(String message) {
+		this.message = message;
+	}
+
+	public SimpleResponse() {
+	}
+
+	public SimpleResponse(String message) {
+		this.message = message;
+	}
+
+}

BIN
java11-blank-pojo-event/target/classes/example/PojoHandler.class


BIN
java11-blank-pojo-event/target/classes/example/SimpleRequest.class


BIN
java11-blank-pojo-event/target/classes/example/SimpleResponse.class


+ 3 - 0
java11-blank-pojo-event/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1,3 @@
+example/PojoHandler.class
+example/SimpleResponse.class
+example/SimpleRequest.class

+ 3 - 0
java11-blank-pojo-event/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1,3 @@
+/Users/jackd/dev/ai/test-pipeline/java11-blank-pojo-event/src/main/java/example/SimpleResponse.java
+/Users/jackd/dev/ai/test-pipeline/java11-blank-pojo-event/src/main/java/example/PojoHandler.java
+/Users/jackd/dev/ai/test-pipeline/java11-blank-pojo-event/src/main/java/example/SimpleRequest.java

+ 82 - 0
java11-blank-stream-event/README.md

@@ -0,0 +1,82 @@
+# java11 stream 事件回调示例程序
+本示例为您展示了 Java runtime 的 stream 事件回调示例程序。
+
+
+## 准备开始
+- [可选] 安装并配置 Serverless Devs 工具。(https://help.aliyun.com/document_detail/195474.html)
+
+## 快速开始
+### 方式一、使用 Serverless Devs 工具编译部署
+
+#### 1. 修改 s.yaml 配置
+- 根据需要修改 access 配置
+
+#### 2. 安装依赖并部署
+
+编译部署代码包
+```shell
+s deploy
+```
+> 注意: `pom.xml` 中有配置 `pre-deploy` 脚本 `mvn package`, 在部署前会调用 `mvn package` 编译打包。
+
+#### 3. 调用测试
+
+```shell
+s invoke --event-file event.txt
+```
+
+调用函数时收到的响应如下所示:
+
+```bash
+Reading event file content:
+Hello world, Hello FC!
+========= FC invoke Logs begin =========
+FC Invoke Start RequestId: ef87e911-7d20-4d5b-b7c3-xxxxxxxxx
+2022-04-08 04:12:35.328 [INFO] Input data: Hello world, Hello FC!
+FC Invoke End RequestId: ef87e911-7d20-4d5b-b7c3-xxxxxxxxx
+
+Duration: 30.87 ms, Billed Duration: 31 ms, Memory Size: 128 MB, Max Memory Used: 66.68 MB
+========= FC invoke Logs end =========
+
+FC Invoke Result:
+Hello world, Hello FC!
+
+
+End of method: invoke
+```
+
+### 方式二、使用控制台创建
+
+#### 1. 编译打包
+
+```shell
+# 编译部署
+mvn package
+# 打包文件
+cd target && zip -r java11-stream-event-blank.zip *
+```
+
+#### 2. 创建函数
+选择服务(或创建服务)后,单击创建函数,如图所示
+- 选择 `从零开始创建`
+- 填入函数名称
+- 选择运行环境 java11/java8
+- 选择函数触发方式:通过事件请求触发
+- [请求处理程序](https://help.aliyun.com/document_detail/432663.html)(函数入口)设为:example.StreamHandler::handleRequest
+- 其他设置使用默认
+
+![img_1.png](assets/20220608154125.jpg)
+
+> 详细创建函数流程见文档: [使用控制台创建函数](https://help.aliyun.com/document_detail/51783.html)
+
+#### 3. 配置测试参数
+在函数管理页面的测试函数标签栏配置测试参数
+
+![img_2.png](assets/20220608154802.jpg)
+
+#### 4. 测试函数
+
+返回结果如下所示
+```bash
+"Hello world, Hello FC!"
+```

BIN
java11-blank-stream-event/assets/20220608154125.jpg


BIN
java11-blank-stream-event/assets/20220608154802.jpg


+ 49 - 0
java11-blank-stream-event/dependency-reduced-pom.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>java11-blank-stream-event</artifactId>
+  <name>HelloFCJava</name>
+  <version>1.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <filters>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <properties>
+    <maven.compiler.target>1.11</maven.compiler.target>
+    <maven.test.skip>true</maven.test.skip>
+    <maven.compiler.source>1.11</maven.compiler.source>
+  </properties>
+</project>

+ 1 - 0
java11-blank-stream-event/event.txt

@@ -0,0 +1 @@
+Hello world, Hello FC!

+ 59 - 0
java11-blank-stream-event/pom.xml

@@ -0,0 +1,59 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>java11-blank-stream-event</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>HelloFCJava</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun.fc.runtime</groupId>
+      <artifactId>fc-java-core</artifactId>
+      <version>1.4.1</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-shade-plugin</artifactId>
+          <version>3.2.1</version>
+          <executions>
+            <execution>
+              <phase>package</phase>
+              <goals>
+                <goal>shade</goal>
+              </goals>
+              <configuration>
+                <filters>
+                  <filter>
+                    <artifact>*:*</artifact>
+                    <excludes>
+                      <exclude>META-INF/*.SF</exclude>
+                      <exclude>META-INF/*.DSA</exclude>
+                      <exclude>META-INF/*.RSA</exclude>
+                    </excludes>
+                  </filter>
+                </filters>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <maven.compiler.target>11</maven.compiler.target>
+    <maven.compiler.source>11</maven.compiler.source>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+</project>

+ 57 - 0
java11-blank-stream-event/readme_s.md

@@ -0,0 +1,57 @@
+# 阿里云函数计算 Java8 Event 函数案例
+
+<toc>
+
+<p align="center"><b> 中文 | <a href="./readme_en.md"> English </a>  </b></p>
+
+- [快速开始](#快速开始)
+    - [通过应用中心部署](#通过应用中心部署)
+    - [通过命令行工具部署](#通过命令行工具部署)
+    - [通过阿里云CloudShell部署](#通过阿里云CloudShell部署)
+- [应用详情](#应用详情)
+- [关于我们](#关于我们)
+
+</toc>
+
+# 快速开始
+
+- [:octocat: 源代码](https://github.com/devsapp/start-fc/tree/master/event-function/fc-event-java8/src)
+
+## 通过应用中心部署
+
+<appcenter>
+
+您可以在阿里云 [:earth_asia: Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-fc-event-java8) ,快速体验该应用:   
+
+[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-fc-event-java8) 
+
+</appcenter>
+
+## 通过命令行工具部署
+
+> 在开始之前,需要先安装 Serverless Devs 开发者工具:`npm install @serverless-devs/s -g`,更多安装方法,可以参考[Serverless Devs 安装文档](https://www.serverless-devs.com/serverless-devs/install) ,针对阿里云还需要配置密钥信息,配置密钥信息的方法可以参考[阿里云密钥配置文档](https://www.serverless-devs.com/fc/config)
+
+- 初始化项目:`s init start-fc-event-java8 -d start-fc-event-java8`    
+    > 涉及到确定密钥的选择、服务名称的确定、函数名称的确定以及容器镜像的确定    
+- 进入项目:`cd start-fc-event-java8`
+- 部署项目:`s deploy -y`
+- 调用函数:`s invoke -e '{"key":"val"}'`
+
+## 通过阿里云CloudShell部署
+
+如果您不想在应用中心中快速体验,也不想下载命令行工具体验,您也可以在[ :rocket:  阿里云 CloudShell](https://api.aliyun.com/new#/tutorial?action=git_open&git_repo=https://github.com/devsapp/start-fc.git&tutorial=event-function/fc-event-java8/cloudshell.md) 中快速体验。
+
+# 应用详情
+
+本应用仅作为学习和参考使用,您可以基于本项目进行二次开发和完善,实现自己的业务逻辑
+
+# 关于我们
+
+- Serverless Devs 工具:
+    - 仓库:[https://www.github.com/serverless-devs/serverless-devs](https://www.github.com/serverless-devs/serverless-devs)    
+      > 欢迎帮我们增加一个 :star2: 
+    - 官网:[https://www.serverless-devs.com/](https://www.serverless-devs.com/)
+- 阿里云函数计算组件:
+    - 仓库:[https://github.com/devsapp/fc](https://github.com/devsapp/fc)
+    - 帮助文档:[https://www.serverless-devs.com/fc/readme](https://www.serverless-devs.com/fc/readme)
+- 钉钉交流群:33947367    

+ 41 - 0
java11-blank-stream-event/readme_s_en.md

@@ -0,0 +1,41 @@
+# Alibaba Cloud Function Compute Java8 Event function case
+
+<toc>
+
+<p align="center"><b> <a href="./readme.md"> 中文 </a> | English </b></p>
+
+- [Quick start](#Quick-start)
+    - [Deploy via command line tool](#Deploy-via-command-line-tools)
+- [Application details](#Application-details)
+- [About Us](#About-Us)
+
+</toc>
+
+# Quick start
+
+- [:octocat: source](https://github.com/devsapp/start-fc/tree/master/event-function/fc-event-java8/src)
+
+## Deploy via command line tools
+
+> Before starting, you need to install the Serverless Devs developer tools: `npm install @serverless-devs/s -g`, for more installation methods, please refer to [Serverless Devs Installation Documentation](https://www.serverless-devs.com/serverless-devs/install) , you also need to configure key information for Alibaba Cloud. For the method of configuring key information, please refer to [Alibaba Cloud Key Configuration Document](https://www.serverless-devs.com/fc/config)
+
+- Initialize the project: `s init start-fc-event-java8 -d start-fc-event-java8`
+    > It involves determining the selection of the key, the determination of the service name, the determination of the function name, and the determination of the container image
+- Enter the project: `cd start-fc-event-java8`
+- Deploy the project: `s deploy -y`
+- Invoke function: `s invoke -e '{"key":"val"}'`
+
+# Application details
+
+This application is only used for learning and reference. You can carry out secondary development and improvement based on this project to realize your own business logic.
+
+# About Us
+
+- Serverless Devs Tools:
+    - Repository: [https://www.github.com/serverless-devs/serverless-devs](https://www.github.com/serverless-devs/serverless-devs)
+      > Welcome to add a :star2:
+    - Official website: [https://www.serverless-devs.com/](https://www.serverless-devs.com/)
+- Alibaba Cloud Function Compute components:
+    - Repository: [https://github.com/devsapp/fc](https://github.com/devsapp/fc)
+    - Help document: [https://www.serverless-devs.com/fc/readme](https://www.serverless-devs.com/fc/readme)
+- Dingding communication group: 33947367

+ 60 - 0
java11-blank-stream-event/s.yaml

@@ -0,0 +1,60 @@
+# ------------------------------------
+#   If you need English case, you can refer to [s_en.yaml] file
+# ------------------------------------
+#   欢迎您使用阿里云函数计算 FC 组件进行项目开发
+#   组件仓库地址:https://github.com/devsapp/fc
+#   组件帮助文档:https://www.serverless-devs.com/fc/readme
+#   Yaml参考文档:https://www.serverless-devs.com/fc/yaml/readme
+#   关于:
+#      - Serverless Devs和FC组件的关系、如何声明/部署多个函数、超过50M的代码包如何部署
+#      - 关于.fcignore使用方法、工具中.s目录是做什么、函数进行build操作之后如何处理build的产物
+#   等问题,可以参考文档:https://www.serverless-devs.com/fc/tips
+#   关于如何做CICD等问题,可以参考:https://www.serverless-devs.com/serverless-devs/cicd
+#   关于如何进行环境划分等问题,可以参考:https://www.serverless-devs.com/serverless-devs/extend
+#   更多函数计算案例,可参考:https://github.com/devsapp/awesome/
+#   有问题快来钉钉群问一下吧:33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access 是当前应用所需要的密钥信息配置:
+# 密钥配置可以参考:https://www.serverless-devs.com/serverless-devs/command/config
+# 密钥使用顺序可以参考:https://www.serverless-devs.com/serverless-devs/tool#密钥使用顺序与规范
+access: default
+
+vars: # 全局变量
+  region: cn-hangzhou
+  service:
+    name: fc-example
+    description: 'hello world by serverless devs'
+
+services:
+  helloworld: # 业务名称/模块名称
+    # 如果只想针对 helloworld 下面的业务进行相关操作,可以在命令行中加上 helloworld,例如:
+    # 只对helloworld进行构建:s helloworld build
+    # 如果不带有 helloworld ,而是直接执行 s build,工具则会对当前Yaml下,所有和 helloworld 平级的业务模块(如有其他平级的模块,例如下面注释的next-function),按照一定顺序进行 build 操作
+    component: fc # 组件名称,Serverless Devs 工具本身类似于一种游戏机,不具备具体的业务能力,组件类似于游戏卡,用户通过向游戏机中插入不同的游戏卡实现不同的功能,即通过使用不同的组件实现不同的具体业务能力
+    actions: # 自定义执行逻辑,关于actions 的使用,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#行为描述
+      pre-deploy: # 在deploy之前运行
+        - run: mvn package
+          path: ./
+    #        - component: fc build --use-docker --dockerfile ./code/Dockerfile  # 要运行的组件,格式为【component: 组件名 命令 参数】(可以通过s cli registry search --type Component 获取组件列表)
+    #        - run: docker build xxx          # 要执行的系统命令,类似于一种钩子的形式
+    #          path: ./src                    # 执行系统命令/钩子的路径
+    #        - plugin: myplugin               # 与运行的插件 (可以通过s cli registry search --type Plugin 获取组件列表)
+    #          args:                          # 插件的参数信息
+    #            testKey: testValue
+    #      post-deploy: # 在deploy之后运行
+    #        - component: fc versions publish # 要运行的命令行
+    props:
+      region: ${vars.region} # 关于变量的使用方法,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#变量赋值
+      service: ${vars.service}
+      function:
+        name: java11-blank-stream-event
+        description: 'hello world by serverless devs'
+        runtime: java11
+        codeUri: ./target
+        handler: example.StreamHandler::handleRequest
+        memorySize: 128
+        timeout: 60
+        # initializationTimeout: 60
+        # initializer: example.App::initialize

+ 74 - 0
java11-blank-stream-event/s_en.yaml

@@ -0,0 +1,74 @@
+# ------------------------------------
+#   If you want to use this file directly, please add [-t/--template] parameter, for example [s deploy -t s_en.yaml]
+# ------------------------------------
+#   Welcome to use Alibaba Cloud Function Compute FC components for project development
+#   Component warehouse address: https://github.com/devsapp/fc
+#   Component help documentation: https://www.serverless-devs.com/fc/readme
+#   Yaml reference documentation: https://www.serverless-devs.com/fc/yaml/readme
+#   About:
+#     - The relationship between Serverless Devs and FC components, how to declare/deploy multiple functions, how to deploy code packages over 50M
+#     - About the usage of .fcignore, what the .s directory in the tool does, and how to process the build product after the function performs the build operation
+#   and other issues, you can refer to the documentation: https://www.serverless-devs.com/fc/tips
+#   For questions about how to do CICD, please refer to: https://www.serverless-devs.com/serverless-devs/cicd
+#   For issues such as how to divide the environment, please refer to: https://www.serverless-devs.com/serverless-devs/extend
+#   For more function calculation cases, please refer to: https://github.com/devsapp/awesome/blob/main/README_en.md
+#   If you have any questions, please come to the DingTalk group and ask: 33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access is the key information configuration required by the current application:
+# Key configuration can refer to: https://www.serverless-devs.com/serverless-devs/command/config
+# For the order of key usage, please refer to: https://www.serverless-devs.com/serverless-devs/tool#Key usage order and specification
+# access: "{{ access }}"
+
+vars: # global variables
+  region: cn-hangzhou
+  service:
+    name: hello-world-service
+    description: 'hello world by serverless devs'
+
+services:
+  helloworld: # business name/module name
+    # If you only want to perform related operations on the business below helloworld, you can add helloworld to the command line, for example:
+    # Build only helloworld: s helloworld build
+    # If s build is directly executed without helloworld, the tool will perform the same operation on all business modules at the same level as helloworld under the current Yaml (if there are other level modules, such as the next-function commented below), according to certain Sequential build operations
+    component: fc    # The name of the component. The Serverless Devs tool itself is similar to a game console and does not have specific business capabilities. The component is similar to a game card. Users can achieve different functions by inserting different game cards into the game console, that is, by using Different components implement different specific business capabilities
+    actions:         # Customize execution logic. For the use of actions, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Behavior description
+      pre-deploy:    # run before deploy
+        - run: mvn package
+          path: ./
+#        - component: fc build --use-docker --dockerfile ./code/Dockerfile # The component to run, the format is [component: component name command parameter] (you can get the component list through s cli registry search --type Component)
+#        - run: docker build xxx                  # System command to execute, similar to a hook
+#          path: ./src                            # The path to execute system commands/hooks
+#        - plugin: myplugin                       # and running plugins (you can get a list of components via s cli registry search --type Plugin)
+#          args:                                  # parameter information of the plugin
+#            testKey: testValue
+#      post-deploy:                               # run after deploy
+#        - component: fc versions publish         # command line to run
+    props:
+      region: ${vars.region} # For the usage of variables, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Variable assignment
+      service: ${vars.service}
+      function:
+        name: custom-cpp-event-function
+        description: 'hello world by serverless devs'
+        runtime: java8
+        codeUri: ./target
+        handler: example.App::handleRequest
+        memorySize: 128
+        timeout: 60
+        initializationTimeout: 60
+        initializer: example.App::initialize
+#  next-function: # The case of the second function, just for reference
+#    # If you execute s deploy under the current project, the modules will be deployed at the same time:
+#    #   helloworld: service hello-world-service, function cpp-event-function
+#    #   next-function: service hello-world-service, function next-function-example
+#    # If you want to deploy the current service and function separately, you can execute s + module name/business name + deploy, for example: s next-function deploy
+#    # If you want to deploy the current function separately, you can execute s + module name/business name + deploy function, for example: s next-function deploy function
+#    # For more commands, please refer to: https://www.serverless-devs.com/fc/readme#Document related
+#    component: fc
+#    props:
+#      region: ${vars.region}
+#      service: ${vars.service} # The overall service configuration of the application
+#      function: # define a new function
+#        name: next-function-example
+#        description: 'hello world by serverless devs'

+ 28 - 0
java11-blank-stream-event/src/main/java/example/StreamHandler.java

@@ -0,0 +1,28 @@
+package example;
+
+import com.aliyun.fc.runtime.Context;
+import com.aliyun.fc.runtime.FunctionComputeLogger;
+import com.aliyun.fc.runtime.StreamRequestHandler;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
+
+public class StreamHandler implements StreamRequestHandler {
+
+	@Override
+	public void handleRequest(InputStream input, OutputStream output, Context context) throws IOException {
+		FunctionComputeLogger logger = context.getLogger();
+		ByteArrayOutputStream result = new ByteArrayOutputStream();
+		byte[] buffer = new byte[1024];
+		for (int length; (length = input.read(buffer)) != -1;) {
+			result.write(buffer, 0, length);
+		}
+		String res = result.toString(StandardCharsets.UTF_8.name());
+		logger.info("Input data: " + res);
+		output.write(res.getBytes());
+	}
+
+}

BIN
java11-blank-stream-event/target/classes/example/StreamHandler.class


+ 1 - 0
java11-blank-stream-event/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1 @@
+example/StreamHandler.class

+ 1 - 0
java11-blank-stream-event/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1 @@
+/Users/jackd/dev/ai/test-pipeline/java11-blank-stream-event/src/main/java/example/StreamHandler.java

+ 88 - 0
java11-mongodb/README.md

@@ -0,0 +1,88 @@
+# java11 MongoDB示例
+
+本示例为您展示了 Java runtime 的 MongoDB 使用示例。 
+在本示例中,MongoDB 数据库配置在函数的环境变量配置中(参考s.yaml,yaml 配置详见 https://gitee.com/devsapp/fc/tree/main/docs/zh/yaml),initialize 回调函数从环境变量中获取数据库配置,创建 MongoDB 连接,preStop 回调函数负责关闭 MongoDB 连接。回调函数与函数实例生命周期的关系详见 https://help.aliyun.com/document_detail/203027.html
+
+本示例 Driver 使用4.6版本。版本兼容详情见 https://www.mongodb.com/docs/drivers/java/sync/current/compatibility
+
+
+## 准备开始
+- 一个可用的 MongoDB 数据库,可以参考以下命令创建测试数据库。
+
+```bash
+use users
+db.users.insert([
+  {"name": "张三", "age": 18},
+  {"name": "李四", "age": 20}
+])
+```
+
+
+- [可选] 安装并配置 Serverless Devs 工具。(https://help.aliyun.com/document_detail/195474.html)
+
+## 快速开始
+### 方式一、使用 Serverless Devs 工具编译部署
+
+#### 1. 修改 s.yaml 配置
+- 根据需要修改 access 配置
+- 修改 environmentVariables 配置,填入 MONGO_URL, MONGO_DATABASE
+- 使用 initialize 和 prestop 回调,需要在 s.yaml 中配置
+
+```yaml
+        initializationTimeout: 60
+        initializer: example.App::initialize
+        instanceLifecycleConfig:
+          preStop:
+            handler: example.App::preStop
+            timeout: 60
+```
+
+#### 2. 安装依赖并部署
+
+编译部署代码包
+```shell
+s deploy
+```
+> 注意: `pom.xml` 中有配置 `pre-deploy` 脚本 `mvn package`, 在部署前会调用 `mvn package` 编译打包。
+
+#### 3. 调用测试
+
+```shell
+s invoke
+```
+
+调用函数时收到的响应如下所示:
+
+```bash
+========= FC invoke Logs begin =========
+FC Invoke Start RequestId: 71946c57-******
+2022-07-12 03:13:22.763 [INFO] [71946c57-10f7-4548-8574-866cfa29c591] get user: Document{{_id=62cb9e5a5c21fd08dbf68490, name=张三, age=18.0}}
+FC Invoke End RequestId: 71946c57-******
+
+Duration: 344.21 ms, Billed Duration: 345 ms, Memory Size: 128 MB, Max Memory Used: 102.32 MB
+========= FC invoke Logs end =========
+
+FC Invoke instanceId: c-62cce588-******
+
+FC Invoke Result:
+Document{{_id=62cb9e5a5c21fd08dbf68490, name=张三, age=18.0}}
+
+
+End of method: invoke
+```
+
+### 方式二、使用控制台创建
+todo...
+
+## 数据库访问限制
+当使用MongoDB时,一般都会有访问控制,比如云数据库MongoDB中的白名单设置( [MongoDB白名单设置说明](https://help.aliyun.com/document_detail/88888.htm) )。
+
+如果仅仅作为测试,可以将白名单配置成 `0.0.0.0/0`。(不要在生产环境使用!)
+
+在生产环境,可以使用以下两种方式访问:
+
+1. VPC方式(**推荐**) <br>
+   参考文档:https://help.aliyun.com/document_detail/84514.html
+2. 代理方式<br>
+   参考文档:https://help.aliyun.com/document_detail/91243.html
+

+ 49 - 0
java11-mongodb/dependency-reduced-pom.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>java11-mongodb</artifactId>
+  <name>HelloFCJava</name>
+  <version>1.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <filters>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <properties>
+    <maven.compiler.target>1.11</maven.compiler.target>
+    <maven.test.skip>true</maven.test.skip>
+    <maven.compiler.source>1.11</maven.compiler.source>
+  </properties>
+</project>

+ 66 - 0
java11-mongodb/pom.xml

@@ -0,0 +1,66 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>java11-mongodb</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>HelloFCJava</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun.fc.runtime</groupId>
+      <artifactId>fc-java-core</artifactId>
+      <version>1.4.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mongodb</groupId>
+      <artifactId>mongodb-driver-sync</artifactId>
+      <version>4.6.1</version>
+  </dependency>
+
+  </dependencies>
+
+  <build>
+    <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-shade-plugin</artifactId>
+          <version>3.2.1</version>
+          <executions>
+            <execution>
+              <phase>package</phase>
+              <goals>
+                <goal>shade</goal>
+              </goals>
+              <configuration>
+                <filters>
+                  <filter>
+                    <artifact>*:*</artifact>
+                    <excludes>
+                      <exclude>META-INF/*.SF</exclude>
+                      <exclude>META-INF/*.DSA</exclude>
+                      <exclude>META-INF/*.RSA</exclude>
+                    </excludes>
+                  </filter>
+                </filters>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <maven.compiler.target>11</maven.compiler.target>
+    <maven.compiler.source>11</maven.compiler.source>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+</project>

+ 67 - 0
java11-mongodb/s.yaml

@@ -0,0 +1,67 @@
+# ------------------------------------
+#   If you need English case, you can refer to [s_en.yaml] file
+# ------------------------------------
+#   欢迎您使用阿里云函数计算 FC 组件进行项目开发
+#   组件仓库地址:https://github.com/devsapp/fc
+#   组件帮助文档:https://www.serverless-devs.com/fc/readme
+#   Yaml参考文档:https://www.serverless-devs.com/fc/yaml/readme
+#   关于:
+#      - Serverless Devs和FC组件的关系、如何声明/部署多个函数、超过50M的代码包如何部署
+#      - 关于.fcignore使用方法、工具中.s目录是做什么、函数进行build操作之后如何处理build的产物
+#   等问题,可以参考文档:https://www.serverless-devs.com/fc/tips
+#   关于如何做CICD等问题,可以参考:https://www.serverless-devs.com/serverless-devs/cicd
+#   关于如何进行环境划分等问题,可以参考:https://www.serverless-devs.com/serverless-devs/extend
+#   更多函数计算案例,可参考:https://github.com/devsapp/awesome/
+#   有问题快来钉钉群问一下吧:33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access 是当前应用所需要的密钥信息配置:
+# 密钥配置可以参考:https://www.serverless-devs.com/serverless-devs/command/config
+# 密钥使用顺序可以参考:https://www.serverless-devs.com/serverless-devs/tool#密钥使用顺序与规范
+access: default # 配置密钥信息
+
+vars: # 全局变量
+  region: cn-beijing
+  service:
+    name: fc-example
+    description: 'hello world by serverless devs'
+
+services:
+  helloworld: # 业务名称/模块名称
+    # 如果只想针对 helloworld 下面的业务进行相关操作,可以在命令行中加上 helloworld,例如:
+    # 只对helloworld进行构建:s helloworld build
+    # 如果不带有 helloworld ,而是直接执行 s build,工具则会对当前Yaml下,所有和 helloworld 平级的业务模块(如有其他平级的模块,例如下面注释的next-function),按照一定顺序进行 build 操作
+    component: fc # 组件名称,Serverless Devs 工具本身类似于一种游戏机,不具备具体的业务能力,组件类似于游戏卡,用户通过向游戏机中插入不同的游戏卡实现不同的功能,即通过使用不同的组件实现不同的具体业务能力
+    actions: # 自定义执行逻辑,关于actions 的使用,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#行为描述
+       pre-deploy: # 在deploy之前运行
+         - run: mvn package
+           path: ./
+    #        - component: fc build --use-docker --dockerfile ./code/Dockerfile  # 要运行的组件,格式为【component: 组件名 命令 参数】(可以通过s cli registry search --type Component 获取组件列表)
+    #        - run: docker build xxx          # 要执行的系统命令,类似于一种钩子的形式
+    #          path: ./src                    # 执行系统命令/钩子的路径
+    #        - plugin: myplugin               # 与运行的插件 (可以通过s cli registry search --type Plugin 获取组件列表)
+    #          args:                          # 插件的参数信息
+    #            testKey: testValue
+    #      post-deploy: # 在deploy之后运行
+    #        - component: fc versions publish # 要运行的命令行
+    props:
+      region: ${vars.region} # 关于变量的使用方法,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#变量赋值
+      service: ${vars.service}
+      function:
+        name: java11-mongodb
+        description: 'hello world by serverless devs'
+        runtime: java11
+        codeUri: ./target
+        handler: example.App::handleRequest
+        memorySize: 128
+        timeout: 60
+        initializationTimeout: 60
+        initializer: example.App::initialize
+        instanceLifecycleConfig:
+          preStop:
+            handler: example.App::preStop
+            timeout: 60
+        environmentVariables:
+          MONGO_URL: "mongodb://xxxxx" # 设置mongodb数据库配置
+          MONGO_DATABASE: "your database"                        # 设置mongodb数据库配置

+ 53 - 0
java11-mongodb/src/main/java/example/App.java

@@ -0,0 +1,53 @@
+package example;
+
+import static com.mongodb.client.model.Filters.eq;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import com.aliyun.fc.runtime.Context;
+import com.aliyun.fc.runtime.StreamRequestHandler;
+import com.mongodb.client.MongoClient;
+import com.mongodb.client.MongoClients;
+import com.mongodb.client.MongoCollection;
+import com.mongodb.client.MongoDatabase;
+import com.aliyun.fc.runtime.FunctionInitializer;
+import com.aliyun.fc.runtime.PreStopHandler;
+
+import org.bson.Document;
+
+public class App implements StreamRequestHandler, FunctionInitializer, PreStopHandler {
+
+	// mongodb://<hostname>:<port>
+	String MONGO_URL = null;
+
+	String MONGO_DATABASE = null;
+
+	private MongoClient mongoClient = null;
+
+	@Override
+	public void initialize(Context context) {
+		// 在initialize回调中创建客户端,可以实现在整个函数实例生命周期内复用该客户端
+		MONGO_URL = System.getenv("MONGO_URL");
+		MONGO_DATABASE = System.getenv("MONGO_DATABASE");
+		mongoClient = MongoClients.create(MONGO_URL);
+	}
+
+	@Override
+	public void preStop(Context context) {
+		mongoClient.close();
+	}
+
+	@Override
+	public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) throws IOException {
+		MongoDatabase database = mongoClient.getDatabase(MONGO_DATABASE);
+		MongoCollection<Document> collection = database.getCollection("users");
+
+		Document doc = collection.find(eq("name", "张三")).first();
+
+		context.getLogger().info("get user: " + doc.toString());
+		outputStream.write(doc.toString().getBytes());
+	}
+
+}

BIN
java11-mongodb/target/classes/example/App.class


+ 1 - 0
java11-mongodb/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1 @@
+example/App.class

+ 1 - 0
java11-mongodb/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1 @@
+/Users/jackd/dev/ai/test-pipeline/java11-mongodb/src/main/java/example/App.java

+ 148 - 0
java11-mysql/README.md

@@ -0,0 +1,148 @@
+# java11 mysql示例
+
+本示例为您展示了Java runtime的mysql使用示例。
+在本示例中,mysql数据库配置在函数的环境变量配置中(参考s.yaml),initializer 回调函数从环境变量中获取数据库配置,创建mysql连接,preStop 回调函数负责关闭mysql连接。
+
+本示例使用MySQL Connector/J 8.0版本,支持MySQL 5.7 and 8.0,版本兼容详情见 https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-versions.html 。
+
+> MySQL Connector/J 8.0 Developer Guide: https://dev.mysql.com/doc/connector-j/8.0/en/ 
+
+## 准备开始
+- 一个可用的mysql数据库,可以参考以下sql创建表并插入测试数据
+
+```sql
+CREATE TABLE `users` (
+  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+  `name` varchar(20) NOT NULL,
+  `age` tinyint(11) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO `users` (`id`, `name`, `age`) VALUES
+(1, '张三', 18),
+(2, '李四', 28);
+```
+
+- [可选] 安装并配置 Serverless Devs 工具。(https://help.aliyun.com/document_detail/195474.html)
+
+## 快速开始
+### 方式一、使用 Serverless Devs 工具编译部署
+
+#### 1. 修改 s.yaml 配置
+- 根据需要修改 access 配置
+- 修改 environmentVariables 配置,填入 JDBC_URL, JDBC_USER 和 JDBC_PASSWORD
+- 使用 initialize 和 prestop 回调,需要在 s.yaml 中配置
+
+```yaml
+        initializationTimeout: 60
+        initializer: example.App::initialize
+        instanceLifecycleConfig:
+          preStop:
+            handler: example.App::preStop
+            timeout: 60
+```
+
+#### 2. 安装依赖并部署
+
+在 pom.xml 中添加 mysql 依赖,如下所示(在示例pom.xml中已添加该依赖)
+
+```xml
+<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
+<dependency>
+    <groupId>mysql</groupId>
+    <artifactId>mysql-connector-java</artifactId>
+    <version>8.0.28</version>
+</dependency>
+```
+
+编译部署代码包
+```shell
+s deploy
+```
+
+> 注意: `s.yaml` 文件中有配置 `pre-deploy` 脚本, 该脚本会在部署前会调用 `mvn package` 编译。
+
+#### 3. 调用测试
+
+```shell
+s invoke
+```
+
+调用函数时收到的响应如下所示:
+
+```bash
+========= FC invoke Logs begin =========
+FC Initialize Start RequestId: 9fe60072-7fe2-4f62-9d13-xxxxxxx
+[Name] Register [com.aliyun.serverless.runtime.classloader.FunctionClassLoader@58372a00] as [com.aliyun.serverless.runtime.classloader.FunctionClassLoader@com.aliyun.serverless.runtime.classloader.FunctionClassLoader@/code/HelloFCJava-1.0-SNAPSHOT.jar/code/original-HelloFCJava-1.0-SNAPSHOT.jar]: hash [8bbd2e0] (normal mode)
+2022-07-19 04:21:54.577 [INFO] [9fe60072-7fe2-4f62-9d13-62fc04156f77] database connection time cost: 397ms
+FC Initialize End RequestId: 9fe60072-7fe2-4f62-9d13-xxxxxxx
+FC Invoke Start RequestId: 7581b7c4-bb40-4690-90d6-xxxxxxx
+2022-07-19 04:21:59.539 [INFO] [7581b7c4-bb40-4690-90d6-xxxxxxx] Success - 1 rows affected.
+2022-07-19 04:21:59.613 [INFO] [7581b7c4-bb40-4690-90d6-xxxxxxx] get user: {name=王五, id=3, age=5}
+FC Invoke End RequestId: 7581b7c4-bb40-4690-90d6-xxxxxxx
+
+Duration: 108.03 ms, Billed Duration: 109 ms, Memory Size: 128 MB, Max Memory Used: 109.13 MB
+========= FC invoke Logs end =========
+
+FC Invoke instanceId: c-62d63161-a82af772bxxxxxxx
+
+FC Invoke Result:
+{name=王五, id=3, age=5}
+
+
+End of method: invoke
+```
+
+### 方式二、使用控制台创建
+
+#### 1. 编译打包
+
+```shell
+# 编译部署
+mvn package
+# 打包文件
+cd target && zip -r java11-mysql.zip *
+```
+
+#### 2. 创建函数
+选择服务(或创建服务)后,单击创建函数,如图所示
+- 选择 `从零开始创建`
+- 填入函数名称
+- 选择运行环境 java11/java8
+- 选择函数触发方式:通过事件请求触发
+- 其他设置使用默认
+
+
+
+> 详细创建函数流程见文档: [使用控制台创建函数](https://help.aliyun.com/document_detail/51783.html)
+
+#### 3. 设置initializer/preStop回调函数配置和环境变量配置
+
+回调函数配置
+![img_1.png](assets/20220411105111.jpg)
+
+环境变量配置
+
+![img_2.png](assets/20220411105312.jpg)
+
+#### 4. 测试函数
+
+返回结果如下所示
+```bash
+{name=王五, id=3, age=5}
+```
+
+## 数据库访问限制
+当使用云数据库时,一般都会有访问控制,比如阿里云数据库RDS中的白名单设置( [RDS白名单设置说明](https://help.aliyun.com/document_detail/43185.html?spm=5176.19908528.help.dexternal.6c721450iLu0jH) )。
+
+如果仅仅作为测试,可以将白名单配置成 `0.0.0.0/0`。(不要在生产环境使用!)
+
+在生产环境,可以使用以下两种方式访问:
+
+1. VPC方式(**推荐**) <br>
+   参考文档:https://help.aliyun.com/document_detail/84514.html
+2. 代理方式<br>
+   参考文档:https://help.aliyun.com/document_detail/91243.html
+
+## 备注
+1. 本示例不是连接池方式,若要使用连接池,可以参考文档 [Connection Pooling with Connector/J](https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-usagenotes-j2ee-concepts-connection-pooling.html)

BIN
java11-mysql/assets/20220411105111.jpg


BIN
java11-mysql/assets/20220411105312.jpg


+ 49 - 0
java11-mysql/dependency-reduced-pom.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>java11-mysql</artifactId>
+  <name>HelloFCJava</name>
+  <version>1.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <filters>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <properties>
+    <maven.compiler.target>1.11</maven.compiler.target>
+    <maven.test.skip>true</maven.test.skip>
+    <maven.compiler.source>1.11</maven.compiler.source>
+  </properties>
+</project>

+ 67 - 0
java11-mysql/pom.xml

@@ -0,0 +1,67 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>java11-mysql</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>HelloFCJava</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun.fc.runtime</groupId>
+      <artifactId>fc-java-core</artifactId>
+      <version>1.4.1</version>
+    </dependency>
+
+    <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
+    <dependency>
+        <groupId>mysql</groupId>
+        <artifactId>mysql-connector-java</artifactId>
+        <version>8.0.28</version>
+    </dependency>
+
+  </dependencies>
+
+  <build>
+    <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-shade-plugin</artifactId>
+          <version>3.2.1</version>
+          <executions>
+            <execution>
+              <phase>package</phase>
+              <goals>
+                <goal>shade</goal>
+              </goals>
+              <configuration>
+                <filters>
+                  <filter>
+                    <artifact>*:*</artifact>
+                    <excludes>
+                      <exclude>META-INF/*.SF</exclude>
+                      <exclude>META-INF/*.DSA</exclude>
+                      <exclude>META-INF/*.RSA</exclude>
+                    </excludes>
+                  </filter>
+                </filters>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <maven.compiler.target>11</maven.compiler.target>
+    <maven.compiler.source>11</maven.compiler.source>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+</project>

+ 57 - 0
java11-mysql/readme_s.md

@@ -0,0 +1,57 @@
+# 阿里云函数计算 Java8 Event 函数案例
+
+<toc>
+
+<p align="center"><b> 中文 | <a href="readme_s_en.md"> English </a>  </b></p>
+
+- [快速开始](#快速开始)
+    - [通过应用中心部署](#通过应用中心部署)
+    - [通过命令行工具部署](#通过命令行工具部署)
+    - [通过阿里云CloudShell部署](#通过阿里云CloudShell部署)
+- [应用详情](#应用详情)
+- [关于我们](#关于我们)
+
+</toc>
+
+# 快速开始
+
+- [:octocat: 源代码](https://github.com/devsapp/start-fc/tree/master/event-function/fc-event-java8/src)
+
+## 通过应用中心部署
+
+<appcenter>
+
+您可以在阿里云 [:earth_asia: Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-fc-event-java8) ,快速体验该应用:   
+
+[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-fc-event-java8) 
+
+</appcenter>
+
+## 通过命令行工具部署
+
+> 在开始之前,需要先安装 Serverless Devs 开发者工具:`npm install @serverless-devs/s -g`,更多安装方法,可以参考[Serverless Devs 安装文档](https://www.serverless-devs.com/serverless-devs/install) ,针对阿里云还需要配置密钥信息,配置密钥信息的方法可以参考[阿里云密钥配置文档](https://www.serverless-devs.com/fc/config)
+
+- 初始化项目:`s init start-fc-event-java8 -d start-fc-event-java8`    
+    > 涉及到确定密钥的选择、服务名称的确定、函数名称的确定以及容器镜像的确定    
+- 进入项目:`cd start-fc-event-java8`
+- 部署项目:`s deploy -y`
+- 调用函数:`s invoke -e '{"key":"val"}'`
+
+## 通过阿里云CloudShell部署
+
+如果您不想在应用中心中快速体验,也不想下载命令行工具体验,您也可以在[ :rocket:  阿里云 CloudShell](https://api.aliyun.com/new#/tutorial?action=git_open&git_repo=https://github.com/devsapp/start-fc.git&tutorial=event-function/fc-event-java8/cloudshell.md) 中快速体验。
+
+# 应用详情
+
+本应用仅作为学习和参考使用,您可以基于本项目进行二次开发和完善,实现自己的业务逻辑
+
+# 关于我们
+
+- Serverless Devs 工具:
+    - 仓库:[https://www.github.com/serverless-devs/serverless-devs](https://www.github.com/serverless-devs/serverless-devs)    
+      > 欢迎帮我们增加一个 :star2: 
+    - 官网:[https://www.serverless-devs.com/](https://www.serverless-devs.com/)
+- 阿里云函数计算组件:
+    - 仓库:[https://github.com/devsapp/fc](https://github.com/devsapp/fc)
+    - 帮助文档:[https://www.serverless-devs.com/fc/readme](https://www.serverless-devs.com/fc/readme)
+- 钉钉交流群:33947367    

+ 41 - 0
java11-mysql/readme_s_en.md

@@ -0,0 +1,41 @@
+# Alibaba Cloud Function Compute Java8 Event function case
+
+<toc>
+
+<p align="center"><b> <a href="readme_s.md"> 中文 </a> | English </b></p>
+
+- [Quick start](#Quick-start)
+    - [Deploy via command line tool](#Deploy-via-command-line-tools)
+- [Application details](#Application-details)
+- [About Us](#About-Us)
+
+</toc>
+
+# Quick start
+
+- [:octocat: source](https://github.com/devsapp/start-fc/tree/master/event-function/fc-event-java8/src)
+
+## Deploy via command line tools
+
+> Before starting, you need to install the Serverless Devs developer tools: `npm install @serverless-devs/s -g`, for more installation methods, please refer to [Serverless Devs Installation Documentation](https://www.serverless-devs.com/serverless-devs/install) , you also need to configure key information for Alibaba Cloud. For the method of configuring key information, please refer to [Alibaba Cloud Key Configuration Document](https://www.serverless-devs.com/fc/config)
+
+- Initialize the project: `s init start-fc-event-java8 -d start-fc-event-java8`
+    > It involves determining the selection of the key, the determination of the service name, the determination of the function name, and the determination of the container image
+- Enter the project: `cd start-fc-event-java8`
+- Deploy the project: `s deploy -y`
+- Invoke function: `s invoke -e '{"key":"val"}'`
+
+# Application details
+
+This application is only used for learning and reference. You can carry out secondary development and improvement based on this project to realize your own business logic.
+
+# About Us
+
+- Serverless Devs Tools:
+    - Repository: [https://www.github.com/serverless-devs/serverless-devs](https://www.github.com/serverless-devs/serverless-devs)
+      > Welcome to add a :star2:
+    - Official website: [https://www.serverless-devs.com/](https://www.serverless-devs.com/)
+- Alibaba Cloud Function Compute components:
+    - Repository: [https://github.com/devsapp/fc](https://github.com/devsapp/fc)
+    - Help document: [https://www.serverless-devs.com/fc/readme](https://www.serverless-devs.com/fc/readme)
+- Dingding communication group: 33947367

+ 69 - 0
java11-mysql/s.yaml

@@ -0,0 +1,69 @@
+# ------------------------------------
+#   If you need English case, you can refer to [s_en.yaml] file
+# ------------------------------------
+#   欢迎您使用阿里云函数计算 FC 组件进行项目开发
+#   组件仓库地址:https://github.com/devsapp/fc
+#   组件帮助文档:https://www.serverless-devs.com/fc/readme
+#   Yaml参考文档:https://www.serverless-devs.com/fc/yaml/readme
+#   关于:
+#      - Serverless Devs和FC组件的关系、如何声明/部署多个函数、超过50M的代码包如何部署
+#      - 关于.fcignore使用方法、工具中.s目录是做什么、函数进行build操作之后如何处理build的产物
+#   等问题,可以参考文档:https://www.serverless-devs.com/fc/tips
+#   关于如何做CICD等问题,可以参考:https://www.serverless-devs.com/serverless-devs/cicd
+#   关于如何进行环境划分等问题,可以参考:https://www.serverless-devs.com/serverless-devs/extend
+#   更多函数计算案例,可参考:https://github.com/devsapp/awesome/
+#   有问题快来钉钉群问一下吧:33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access 是当前应用所需要的密钥信息配置:
+# 密钥配置可以参考:https://www.serverless-devs.com/serverless-devs/command/config
+# 密钥使用顺序可以参考:https://www.serverless-devs.com/serverless-devs/tool#密钥使用顺序与规范
+access: default # 配置密钥信息
+
+vars: # 全局变量
+  region: cn-hangzhou
+  service:
+    name: fc-example
+    description: 'hello world by serverless devs'
+
+services:
+  helloworld: # 业务名称/模块名称
+    # 如果只想针对 helloworld 下面的业务进行相关操作,可以在命令行中加上 helloworld,例如:
+    # 只对helloworld进行构建:s helloworld build
+    # 如果不带有 helloworld ,而是直接执行 s build,工具则会对当前Yaml下,所有和 helloworld 平级的业务模块(如有其他平级的模块,例如下面注释的next-function),按照一定顺序进行 build 操作
+    component: fc # 组件名称,Serverless Devs 工具本身类似于一种游戏机,不具备具体的业务能力,组件类似于游戏卡,用户通过向游戏机中插入不同的游戏卡实现不同的功能,即通过使用不同的组件实现不同的具体业务能力
+    actions: # 自定义执行逻辑,关于actions 的使用,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#行为描述
+       pre-deploy: # 在deploy之前运行
+         - run: mvn package
+           path: ./
+    #        - component: fc build --use-docker --dockerfile ./code/Dockerfile  # 要运行的组件,格式为【component: 组件名 命令 参数】(可以通过s cli registry search --type Component 获取组件列表)
+    #        - run: docker build xxx          # 要执行的系统命令,类似于一种钩子的形式
+    #          path: ./src                    # 执行系统命令/钩子的路径
+    #        - plugin: myplugin               # 与运行的插件 (可以通过s cli registry search --type Plugin 获取组件列表)
+    #          args:                          # 插件的参数信息
+    #            testKey: testValue
+    #      post-deploy: # 在deploy之后运行
+    #        - component: fc versions publish # 要运行的命令行
+    props:
+      region: ${vars.region} # 关于变量的使用方法,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#变量赋值
+      service: ${vars.service}
+      function:
+        name: java11-mysql
+        description: 'hello world by serverless devs'
+        runtime: java11
+        codeUri: ./target
+        handler: example.App::handleRequest
+        memorySize: 128
+        timeout: 60
+        initializationTimeout: 60
+        initializer: example.App::initialize
+        instanceLifecycleConfig:
+          preStop:
+            handler: example.App::preStop
+            timeout: 60
+        environmentVariables:
+          # jdbc:mysql://<hostname>:<port>/<db>
+          JDBC_URL: "jdbc:mysql://<hostname>:<port>/<db>" # 设置mysql数据库配置
+          JDBC_USER: "xxx"                                # 设置mysql数据库配置
+          JDBC_PASSWORD: "xxx"                            # 设置mysql数据库配置

+ 74 - 0
java11-mysql/s_en.yaml

@@ -0,0 +1,74 @@
+# ------------------------------------
+#   If you want to use this file directly, please add [-t/--template] parameter, for example [s deploy -t s_en.yaml]
+# ------------------------------------
+#   Welcome to use Alibaba Cloud Function Compute FC components for project development
+#   Component warehouse address: https://github.com/devsapp/fc
+#   Component help documentation: https://www.serverless-devs.com/fc/readme
+#   Yaml reference documentation: https://www.serverless-devs.com/fc/yaml/readme
+#   About:
+#     - The relationship between Serverless Devs and FC components, how to declare/deploy multiple functions, how to deploy code packages over 50M
+#     - About the usage of .fcignore, what the .s directory in the tool does, and how to process the build product after the function performs the build operation
+#   and other issues, you can refer to the documentation: https://www.serverless-devs.com/fc/tips
+#   For questions about how to do CICD, please refer to: https://www.serverless-devs.com/serverless-devs/cicd
+#   For issues such as how to divide the environment, please refer to: https://www.serverless-devs.com/serverless-devs/extend
+#   For more function calculation cases, please refer to: https://github.com/devsapp/awesome/blob/main/README_en.md
+#   If you have any questions, please come to the DingTalk group and ask: 33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access is the key information configuration required by the current application:
+# Key configuration can refer to: https://www.serverless-devs.com/serverless-devs/command/config
+# For the order of key usage, please refer to: https://www.serverless-devs.com/serverless-devs/tool#Key usage order and specification
+# access: "{{ access }}"
+
+vars: # global variables
+  region: cn-hangzhou
+  service:
+    name: hello-world-service
+    description: 'hello world by serverless devs'
+
+services:
+  helloworld: # business name/module name
+    # If you only want to perform related operations on the business below helloworld, you can add helloworld to the command line, for example:
+    # Build only helloworld: s helloworld build
+    # If s build is directly executed without helloworld, the tool will perform the same operation on all business modules at the same level as helloworld under the current Yaml (if there are other level modules, such as the next-function commented below), according to certain Sequential build operations
+    component: fc    # The name of the component. The Serverless Devs tool itself is similar to a game console and does not have specific business capabilities. The component is similar to a game card. Users can achieve different functions by inserting different game cards into the game console, that is, by using Different components implement different specific business capabilities
+    actions:         # Customize execution logic. For the use of actions, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Behavior description
+      pre-deploy:    # run before deploy
+        - run: mvn package
+          path: ./
+#        - component: fc build --use-docker --dockerfile ./code/Dockerfile # The component to run, the format is [component: component name command parameter] (you can get the component list through s cli registry search --type Component)
+#        - run: docker build xxx                  # System command to execute, similar to a hook
+#          path: ./src                            # The path to execute system commands/hooks
+#        - plugin: myplugin                       # and running plugins (you can get a list of components via s cli registry search --type Plugin)
+#          args:                                  # parameter information of the plugin
+#            testKey: testValue
+#      post-deploy:                               # run after deploy
+#        - component: fc versions publish         # command line to run
+    props:
+      region: ${vars.region} # For the usage of variables, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Variable assignment
+      service: ${vars.service}
+      function:
+        name: custom-cpp-event-function
+        description: 'hello world by serverless devs'
+        runtime: java8
+        codeUri: ./target
+        handler: example.App::handleRequest
+        memorySize: 128
+        timeout: 60
+        initializationTimeout: 60
+        initializer: example.App::initialize
+#  next-function: # The case of the second function, just for reference
+#    # If you execute s deploy under the current project, the modules will be deployed at the same time:
+#    #   helloworld: service hello-world-service, function cpp-event-function
+#    #   next-function: service hello-world-service, function next-function-example
+#    # If you want to deploy the current service and function separately, you can execute s + module name/business name + deploy, for example: s next-function deploy
+#    # If you want to deploy the current function separately, you can execute s + module name/business name + deploy function, for example: s next-function deploy function
+#    # For more commands, please refer to: https://www.serverless-devs.com/fc/readme#Document related
+#    component: fc
+#    props:
+#      region: ${vars.region}
+#      service: ${vars.service} # The overall service configuration of the application
+#      function: # define a new function
+#        name: next-function-example
+#        description: 'hello world by serverless devs'

+ 133 - 0
java11-mysql/src/main/java/example/App.java

@@ -0,0 +1,133 @@
+package example;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import com.aliyun.fc.runtime.Context;
+import com.aliyun.fc.runtime.StreamRequestHandler;
+import com.aliyun.fc.runtime.FunctionInitializer;
+import com.aliyun.fc.runtime.PreStopHandler;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.sql.*;
+
+// Notice, do not import com.mysql.jdbc.*
+// or you will have problems!
+
+public class App implements StreamRequestHandler, FunctionInitializer, PreStopHandler {
+
+	// jdbc:mysql://<hostname>:<port>/<db>
+	String JDBC_URL = null;
+
+	String JDBC_USER = null;
+
+	String JDBC_PASSWORD = null;
+
+	private Connection connect = null;
+
+	private Statement stmt = null;
+
+	private ResultSet rs = null;
+
+	@Override
+	public void initialize(Context context) throws IOException {
+		JDBC_URL = System.getenv("JDBC_URL");
+		JDBC_USER = System.getenv("JDBC_USER");
+		JDBC_PASSWORD = System.getenv("JDBC_PASSWORD");
+		long start = System.currentTimeMillis();
+		try {
+			// The newInstance() call is a work around for some
+			// broken Java implementations
+			Class.forName("com.mysql.cj.jdbc.Driver").getDeclaredConstructor().newInstance();
+			// Setup the connection with the DB
+			connect = DriverManager.getConnection(JDBC_URL, JDBC_USER, JDBC_PASSWORD);
+		}
+		catch (Exception ex) {
+			// handle any errors
+			context.getLogger().error("SQLException: " + ex.getMessage());
+			throw new RuntimeException(ex.getMessage());
+		}
+		finally {
+			context.getLogger().info("database connection time cost: " + (System.currentTimeMillis() - start) + "ms");
+		}
+	}
+
+	@Override
+	public void preStop(Context context) throws IOException {
+		context.getLogger().info("preStop start");
+		if (connect != null) {
+			try {
+				connect.close();
+			}
+			catch (SQLException sqlEx) {
+				context.getLogger().error("SQLException: " + sqlEx.getMessage());
+				context.getLogger().error("SQLState: " + sqlEx.getSQLState());
+				context.getLogger().error("VendorError: " + sqlEx.getErrorCode());
+			}
+			connect = null;
+		}
+		context.getLogger().info("preStop end");
+	}
+
+	@Override
+	public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) throws IOException {
+		Map<String, Object> result = new HashMap<String, Object>();
+		try {
+			// Create a Statement instance that we can use for
+			// 'normal' result sets assuming you have a
+			// Connection 'connect' to a MySQL database already available
+			stmt = connect.createStatement();
+
+			// Insert a user item into the database
+			int rowsEffected = stmt.executeUpdate("INSERT INTO users(name, age) VALUES('王五', 5)");
+			context.getLogger().info("Success - " + rowsEffected + " rows affected.");
+
+			// Get a user item from database
+			// Result set get the result of the SQL query
+			rs = stmt.executeQuery("SELECT * FROM `users` ORDER BY `id` DESC LIMIT 1");
+
+			// ResultSet is initially before the first data set
+			while (rs.next()) {
+				result.put("id", rs.getLong("id"));
+				result.put("name", rs.getString("name"));
+				result.put("age", rs.getShort("age"));
+				break;
+			}
+		}
+		catch (SQLException ex) {
+			// handle any errors
+			context.getLogger().error("SQLException: " + ex.getMessage());
+			context.getLogger().error("SQLState: " + ex.getSQLState());
+			context.getLogger().error("VendorError: " + ex.getErrorCode());
+		}
+		finally {
+			// it is a good idea to release
+			// resources in a finally{} block
+			// in reverse-order of their creation
+			// if they are no-longer needed
+			if (rs != null) {
+				try {
+					rs.close();
+				}
+				catch (SQLException sqlEx) {
+				} // ignore
+				rs = null;
+			}
+
+			if (stmt != null) {
+				try {
+					stmt.close();
+				}
+				catch (SQLException sqlEx) {
+				} // ignore
+
+				stmt = null;
+			}
+		}
+		context.getLogger().info("get user: " + result.toString());
+		outputStream.write(result.toString().getBytes());
+	}
+
+}

BIN
java11-mysql/target/classes/example/App.class


+ 1 - 0
java11-mysql/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1 @@
+example/App.class

+ 1 - 0
java11-mysql/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1 @@
+/Users/jackd/dev/ai/test-pipeline/java11-mysql/src/main/java/example/App.java

+ 81 - 0
java11-oss/README.md

@@ -0,0 +1,81 @@
+# java11 oss 示例程序
+本示例演示了如何使用临时密钥向OSS中上传一个文件。
+
+com.aliyun.oss 版本见 maven  https://mvnrepository.com/artifact/com.aliyun.oss/aliyun-sdk-oss
+
+oss sdk 使用参考 https://help.aliyun.com/document_detail/84781.html
+
+## 准备开始
+- 在指定地域创建 bucket(比如,在北京地域创建名为 `my-bucket`)
+- [可选] 安装并配置 Serverless Devs 工具。(https://help.aliyun.com/document_detail/195474.html)
+
+## 快速开始
+### 方式一、使用 Serverless Devs 工具编译部署
+
+#### 1. 修改 s.yaml 配置
+- 根据需要修改 access 配置
+- 修改 service 中的 role 配置,设置的role需要需要拥有 AliyunOSSFullAccess 权限,建议直接使用 AliyunFCDefaultRole 角色
+
+#### 2. 安装依赖并部署
+
+编译部署代码包
+```shell
+s deploy
+```
+> 注意: `pom.xml` 中有配置 `pre-deploy` 脚本 `mvn package`, 在部署前会调用 `mvn package` 编译打包。
+
+#### 3. 调用测试
+
+```shell
+s invoke
+```
+
+调用函数时收到的响应如下所示:
+
+```bash
+FC Invoke Start RequestId: 7fe813fa-a81f-43c9-8c5f-xxxxxxxx
+FC Invoke End RequestId: 7fe813fa-a81f-43c9-8c5f-xxxxxxxx
+
+Duration: 1105.06 ms, Billed Duration: 1106 ms, Memory Size: 128 MB, Max Memory Used: 121.36 MB
+========= FC invoke Logs end =========
+
+FC Invoke Result:
+done
+
+
+End of method: invoke
+```
+
+### 方式二、使用控制台创建
+
+#### 1. 编译打包
+
+```shell
+# 编译部署
+mvn package
+# 打包文件
+cd target && zip -r java11-oss.zip *
+```
+
+#### 2. 创建函数
+选择服务(或创建服务)后,单击创建函数,如图所示
+- 选择 `从零开始创建`
+- 填入函数名称
+- 选择运行环境 java11/java8
+- 选择函数触发方式:通过事件请求触发
+- [请求处理程序](https://help.aliyun.com/document_detail/432663.html)(函数入口)设为:example.App::handleRequest
+- 其他设置使用默认
+
+![img_1.png](assets/20220608161024.jpg)
+
+> 详细创建函数流程见文档: [使用控制台创建函数](https://help.aliyun.com/document_detail/51783.html)
+
+#### 3. 设置服务的角色配置
+编辑服务的配置,将角色设置为AliyunOSSFullAccess,或者创建新的服务角色,但要保证角色中有 AliyunOSSFullAccess 权限策略。
+
+#### 4. 测试函数
+
+返回结果如下所示
+```bash
+done
+```

BIN
java11-oss/assets/20220608161024.jpg


+ 49 - 0
java11-oss/dependency-reduced-pom.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>java11-oss</artifactId>
+  <name>HelloFCJava</name>
+  <version>1.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <filters>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <properties>
+    <maven.compiler.target>1.11</maven.compiler.target>
+    <maven.test.skip>true</maven.test.skip>
+    <maven.compiler.source>1.11</maven.compiler.source>
+  </properties>
+</project>

+ 67 - 0
java11-oss/pom.xml

@@ -0,0 +1,67 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>java11-oss</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>HelloFCJava</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun.fc.runtime</groupId>
+      <artifactId>fc-java-core</artifactId>
+      <version>1.4.1</version>
+    </dependency>
+
+    <!-- https://mvnrepository.com/artifact/com.aliyun.oss/aliyun-sdk-oss -->
+    <dependency>
+        <groupId>com.aliyun.oss</groupId>
+        <artifactId>aliyun-sdk-oss</artifactId>
+        <version>3.14.0</version>
+    </dependency>
+
+  </dependencies>
+
+  <build>
+    <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-shade-plugin</artifactId>
+          <version>3.2.1</version>
+          <executions>
+            <execution>
+              <phase>package</phase>
+              <goals>
+                <goal>shade</goal>
+              </goals>
+              <configuration>
+                <filters>
+                  <filter>
+                    <artifact>*:*</artifact>
+                    <excludes>
+                      <exclude>META-INF/*.SF</exclude>
+                      <exclude>META-INF/*.DSA</exclude>
+                      <exclude>META-INF/*.RSA</exclude>
+                    </excludes>
+                  </filter>
+                </filters>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <maven.compiler.target>11</maven.compiler.target>
+    <maven.compiler.source>11</maven.compiler.source>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+</project>

+ 57 - 0
java11-oss/readme_s.md

@@ -0,0 +1,57 @@
+# 阿里云函数计算 Java8 Event 函数案例
+
+<toc>
+
+<p align="center"><b> 中文 | <a href="./readme_en.md"> English </a>  </b></p>
+
+- [快速开始](#快速开始)
+    - [通过应用中心部署](#通过应用中心部署)
+    - [通过命令行工具部署](#通过命令行工具部署)
+    - [通过阿里云CloudShell部署](#通过阿里云CloudShell部署)
+- [应用详情](#应用详情)
+- [关于我们](#关于我们)
+
+</toc>
+
+# 快速开始
+
+- [:octocat: 源代码](https://github.com/devsapp/start-fc/tree/master/event-function/fc-event-java8/src)
+
+## 通过应用中心部署
+
+<appcenter>
+
+您可以在阿里云 [:earth_asia: Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-fc-event-java8) ,快速体验该应用:   
+
+[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-fc-event-java8) 
+
+</appcenter>
+
+## 通过命令行工具部署
+
+> 在开始之前,需要先安装 Serverless Devs 开发者工具:`npm install @serverless-devs/s -g`,更多安装方法,可以参考[Serverless Devs 安装文档](https://www.serverless-devs.com/serverless-devs/install) ,针对阿里云还需要配置密钥信息,配置密钥信息的方法可以参考[阿里云密钥配置文档](https://www.serverless-devs.com/fc/config)
+
+- 初始化项目:`s init start-fc-event-java8 -d start-fc-event-java8`    
+    > 涉及到确定密钥的选择、服务名称的确定、函数名称的确定以及容器镜像的确定    
+- 进入项目:`cd start-fc-event-java8`
+- 部署项目:`s deploy -y`
+- 调用函数:`s invoke -e '{"key":"val"}'`
+
+## 通过阿里云CloudShell部署
+
+如果您不想在应用中心中快速体验,也不想下载命令行工具体验,您也可以在[ :rocket:  阿里云 CloudShell](https://api.aliyun.com/new#/tutorial?action=git_open&git_repo=https://github.com/devsapp/start-fc.git&tutorial=event-function/fc-event-java8/cloudshell.md) 中快速体验。
+
+# 应用详情
+
+本应用仅作为学习和参考使用,您可以基于本项目进行二次开发和完善,实现自己的业务逻辑
+
+# 关于我们
+
+- Serverless Devs 工具:
+    - 仓库:[https://www.github.com/serverless-devs/serverless-devs](https://www.github.com/serverless-devs/serverless-devs)    
+      > 欢迎帮我们增加一个 :star2: 
+    - 官网:[https://www.serverless-devs.com/](https://www.serverless-devs.com/)
+- 阿里云函数计算组件:
+    - 仓库:[https://github.com/devsapp/fc](https://github.com/devsapp/fc)
+    - 帮助文档:[https://www.serverless-devs.com/fc/readme](https://www.serverless-devs.com/fc/readme)
+- 钉钉交流群:33947367    

+ 41 - 0
java11-oss/readme_s_en.md

@@ -0,0 +1,41 @@
+# Alibaba Cloud Function Compute Java8 Event function case
+
+<toc>
+
+<p align="center"><b> <a href="./readme.md"> 中文 </a> | English </b></p>
+
+- [Quick start](#Quick-start)
+    - [Deploy via command line tool](#Deploy-via-command-line-tools)
+- [Application details](#Application-details)
+- [About Us](#About-Us)
+
+</toc>
+
+# Quick start
+
+- [:octocat: source](https://github.com/devsapp/start-fc/tree/master/event-function/fc-event-java8/src)
+
+## Deploy via command line tools
+
+> Before starting, you need to install the Serverless Devs developer tools: `npm install @serverless-devs/s -g`, for more installation methods, please refer to [Serverless Devs Installation Documentation](https://www.serverless-devs.com/serverless-devs/install) , you also need to configure key information for Alibaba Cloud. For the method of configuring key information, please refer to [Alibaba Cloud Key Configuration Document](https://www.serverless-devs.com/fc/config)
+
+- Initialize the project: `s init start-fc-event-java8 -d start-fc-event-java8`
+    > It involves determining the selection of the key, the determination of the service name, the determination of the function name, and the determination of the container image
+- Enter the project: `cd start-fc-event-java8`
+- Deploy the project: `s deploy -y`
+- Invoke function: `s invoke -e '{"key":"val"}'`
+
+# Application details
+
+This application is only used for learning and reference. You can carry out secondary development and improvement based on this project to realize your own business logic.
+
+# About Us
+
+- Serverless Devs Tools:
+    - Repository: [https://www.github.com/serverless-devs/serverless-devs](https://www.github.com/serverless-devs/serverless-devs)
+      > Welcome to add a :star2:
+    - Official website: [https://www.serverless-devs.com/](https://www.serverless-devs.com/)
+- Alibaba Cloud Function Compute components:
+    - Repository: [https://github.com/devsapp/fc](https://github.com/devsapp/fc)
+    - Help document: [https://www.serverless-devs.com/fc/readme](https://www.serverless-devs.com/fc/readme)
+- Dingding communication group: 33947367

+ 63 - 0
java11-oss/s.yaml

@@ -0,0 +1,63 @@
+# ------------------------------------
+#   If you need English case, you can refer to [s_en.yaml] file
+# ------------------------------------
+#   欢迎您使用阿里云函数计算 FC 组件进行项目开发
+#   组件仓库地址:https://github.com/devsapp/fc
+#   组件帮助文档:https://www.serverless-devs.com/fc/readme
+#   Yaml参考文档:https://www.serverless-devs.com/fc/yaml/readme
+#   关于:
+#      - Serverless Devs和FC组件的关系、如何声明/部署多个函数、超过50M的代码包如何部署
+#      - 关于.fcignore使用方法、工具中.s目录是做什么、函数进行build操作之后如何处理build的产物
+#   等问题,可以参考文档:https://www.serverless-devs.com/fc/tips
+#   关于如何做CICD等问题,可以参考:https://www.serverless-devs.com/serverless-devs/cicd
+#   关于如何进行环境划分等问题,可以参考:https://www.serverless-devs.com/serverless-devs/extend
+#   更多函数计算案例,可参考:https://github.com/devsapp/awesome/
+#   有问题快来钉钉群问一下吧:33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access 是当前应用所需要的密钥信息配置:
+# 密钥配置可以参考:https://www.serverless-devs.com/serverless-devs/command/config
+# 密钥使用顺序可以参考:https://www.serverless-devs.com/serverless-devs/tool#密钥使用顺序与规范
+access: default
+
+vars: # 全局变量
+  region: cn-hangzhou
+  service:
+    name: fc-example
+    description: 'hello world by serverless devs'
+    ## 设置成自己的role, 并且角色需要拥有AliyunOSSFullAccess权限
+    ## 推荐使用函数计算的默认角色 aliyunfcdefaultrole
+    role: "acs:ram::{your-own-accountId}:role/aliyunfcdefaultrole" 
+
+services:
+  helloworld: # 业务名称/模块名称
+    # 如果只想针对 helloworld 下面的业务进行相关操作,可以在命令行中加上 helloworld,例如:
+    # 只对helloworld进行构建:s helloworld build
+    # 如果不带有 helloworld ,而是直接执行 s build,工具则会对当前Yaml下,所有和 helloworld 平级的业务模块(如有其他平级的模块,例如下面注释的next-function),按照一定顺序进行 build 操作
+    component: fc # 组件名称,Serverless Devs 工具本身类似于一种游戏机,不具备具体的业务能力,组件类似于游戏卡,用户通过向游戏机中插入不同的游戏卡实现不同的功能,即通过使用不同的组件实现不同的具体业务能力
+    actions: # 自定义执行逻辑,关于actions 的使用,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#行为描述
+      pre-deploy: # 在deploy之前运行
+        - run: mvn package
+          path: ./
+    #        - component: fc build --use-docker --dockerfile ./code/Dockerfile  # 要运行的组件,格式为【component: 组件名 命令 参数】(可以通过s cli registry search --type Component 获取组件列表)
+    #        - run: docker build xxx          # 要执行的系统命令,类似于一种钩子的形式
+    #          path: ./src                    # 执行系统命令/钩子的路径
+    #        - plugin: myplugin               # 与运行的插件 (可以通过s cli registry search --type Plugin 获取组件列表)
+    #          args:                          # 插件的参数信息
+    #            testKey: testValue
+    #      post-deploy: # 在deploy之后运行
+    #        - component: fc versions publish # 要运行的命令行
+    props:
+      region: ${vars.region} # 关于变量的使用方法,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#变量赋值
+      service: ${vars.service}
+      function:
+        name: java11-blank-stream-event
+        description: 'hello world by serverless devs'
+        runtime: java11
+        codeUri: ./target
+        handler: example.App::handleRequest
+        memorySize: 128
+        timeout: 60
+        # initializationTimeout: 60
+        # initializer: example.App::initialize

+ 74 - 0
java11-oss/s_en.yaml

@@ -0,0 +1,74 @@
+# ------------------------------------
+#   If you want to use this file directly, please add [-t/--template] parameter, for example [s deploy -t s_en.yaml]
+# ------------------------------------
+#   Welcome to use Alibaba Cloud Function Compute FC components for project development
+#   Component warehouse address: https://github.com/devsapp/fc
+#   Component help documentation: https://www.serverless-devs.com/fc/readme
+#   Yaml reference documentation: https://www.serverless-devs.com/fc/yaml/readme
+#   About:
+#     - The relationship between Serverless Devs and FC components, how to declare/deploy multiple functions, how to deploy code packages over 50M
+#     - About the usage of .fcignore, what the .s directory in the tool does, and how to process the build product after the function performs the build operation
+#   and other issues, you can refer to the documentation: https://www.serverless-devs.com/fc/tips
+#   For questions about how to do CICD, please refer to: https://www.serverless-devs.com/serverless-devs/cicd
+#   For issues such as how to divide the environment, please refer to: https://www.serverless-devs.com/serverless-devs/extend
+#   For more function calculation cases, please refer to: https://github.com/devsapp/awesome/blob/main/README_en.md
+#   If you have any questions, please come to the DingTalk group and ask: 33947367
+# ------------------------------------
+edition: 1.0.0
+name: hello-world-app
+# access is the key information configuration required by the current application:
+# Key configuration can refer to: https://www.serverless-devs.com/serverless-devs/command/config
+# For the order of key usage, please refer to: https://www.serverless-devs.com/serverless-devs/tool#Key usage order and specification
+# access: "{{ access }}"
+
+vars: # global variables
+  region: cn-hangzhou
+  service:
+    name: hello-world-service
+    description: 'hello world by serverless devs'
+
+services:
+  helloworld: # business name/module name
+    # If you only want to perform related operations on the business below helloworld, you can add helloworld to the command line, for example:
+    # Build only helloworld: s helloworld build
+    # If s build is directly executed without helloworld, the tool will perform the same operation on all business modules at the same level as helloworld under the current Yaml (if there are other level modules, such as the next-function commented below), according to certain Sequential build operations
+    component: fc    # The name of the component. The Serverless Devs tool itself is similar to a game console and does not have specific business capabilities. The component is similar to a game card. Users can achieve different functions by inserting different game cards into the game console, that is, by using Different components implement different specific business capabilities
+    actions:         # Customize execution logic. For the use of actions, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Behavior description
+      pre-deploy:    # run before deploy
+        - run: mvn package
+          path: ./
+#        - component: fc build --use-docker --dockerfile ./code/Dockerfile # The component to run, the format is [component: component name command parameter] (you can get the component list through s cli registry search --type Component)
+#        - run: docker build xxx                  # System command to execute, similar to a hook
+#          path: ./src                            # The path to execute system commands/hooks
+#        - plugin: myplugin                       # and running plugins (you can get a list of components via s cli registry search --type Plugin)
+#          args:                                  # parameter information of the plugin
+#            testKey: testValue
+#      post-deploy:                               # run after deploy
+#        - component: fc versions publish         # command line to run
+    props:
+      region: ${vars.region} # For the usage of variables, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Variable assignment
+      service: ${vars.service}
+      function:
+        name: custom-cpp-event-function
+        description: 'hello world by serverless devs'
+        runtime: java8
+        codeUri: ./target
+        handler: example.App::handleRequest
+        memorySize: 128
+        timeout: 60
+        initializationTimeout: 60
+        initializer: example.App::initialize
+#  next-function: # The case of the second function, just for reference
+#    # If you execute s deploy under the current project, the modules will be deployed at the same time:
+#    #   helloworld: service hello-world-service, function cpp-event-function
+#    #   next-function: service hello-world-service, function next-function-example
+#    # If you want to deploy the current service and function separately, you can execute s + module name/business name + deploy, for example: s next-function deploy
+#    # If you want to deploy the current function separately, you can execute s + module name/business name + deploy function, for example: s next-function deploy function
+#    # For more commands, please refer to: https://www.serverless-devs.com/fc/readme#Document related
+#    component: fc
+#    props:
+#      region: ${vars.region}
+#      service: ${vars.service} # The overall service configuration of the application
+#      function: # define a new function
+#        name: next-function-example
+#        description: 'hello world by serverless devs'

+ 43 - 0
java11-oss/src/main/java/example/App.java

@@ -0,0 +1,43 @@
+package example;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import com.aliyun.fc.runtime.Context;
+import com.aliyun.fc.runtime.Credentials;
+import com.aliyun.fc.runtime.StreamRequestHandler;
+import com.aliyun.oss.OSS;
+import com.aliyun.oss.OSSClientBuilder;
+
+public class App implements StreamRequestHandler {
+
+	@Override
+	public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) throws IOException {
+
+		// Bucket 名称, 需要预先创建
+		String bucketName = "my-bucket";
+		// Endpoint必须填写Bucket所在地域对应的Endpoint,推荐使用内网访问地址。以华东1(杭州)为例,内网访问Endpoint为https://oss-cn-hangzhou-internal.aliyuncs.com。
+		String endpoint = "https://oss-cn-hangzhou-internal.aliyuncs.com";
+
+		// 获取密钥信息,执行前,确保函数所在的服务配置了角色信息,并且角色需要拥有AliyunOSSFullAccess权限
+		// 建议直接使用AliyunFCDefaultRole 角色
+		Credentials creds = context.getExecutionCredentials();
+
+		// 创建OSSClient实例。
+		OSS ossClient = new OSSClientBuilder().build(endpoint, creds.getAccessKeyId(), creds.getAccessKeySecret(),
+				creds.getSecurityToken());
+
+		// 填写Byte数组。
+		byte[] content = "Hello FC".getBytes();
+		// 依次填写Bucket名称(例如examplebucket)和Object完整路径(例如exampledir/exampleobject.txt)。Object完整路径中不能包含Bucket名称。
+		ossClient.putObject(bucketName, "exampledir/exampleobject.txt", new ByteArrayInputStream(content));
+
+		// 关闭OSSClient
+		ossClient.shutdown();
+
+		outputStream.write(new String("done").getBytes());
+	}
+
+}

BIN
java11-oss/target/classes/example/App.class


+ 1 - 0
java11-oss/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1 @@
+example/App.class

+ 1 - 0
java11-oss/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1 @@
+/Users/jackd/dev/ai/test-pipeline/java11-oss/src/main/java/example/App.java

+ 103 - 0
mongodb-java-http/README.md

@@ -0,0 +1,103 @@
+# start-java11-mongodb-http 帮助文档
+
+<p align="center" class="flex justify-center">
+    <a href="https://www.serverless-devs.com" class="ml-1">
+    <img src="http://editor.devsapp.cn/icon?package=start-java11-mongodb-http&type=packageType">
+  </a>
+  <a href="http://www.devsapp.cn/details.html?name=start-java11-mongodb-http" class="ml-1">
+    <img src="http://editor.devsapp.cn/icon?package=start-java11-mongodb-http&type=packageVersion">
+  </a>
+  <a href="http://www.devsapp.cn/details.html?name=start-java11-mongodb-http" class="ml-1">
+    <img src="http://editor.devsapp.cn/icon?package=start-java11-mongodb-http&type=packageDownload">
+  </a>
+</p>
+
+<description>
+
+本示例为您展示了 Java Runtime 的 MongoDB 使用示例。
+在本示例中,表格存储实例配置在函数的环境变量配置中,initializer 回调函数从环境变量中获取配置,创建 MongoDB 连接,可以实现在整个函数实例生命周期内复用该连接,preStop 回调函数负责关闭 MongoDB 连接。
+
+本示例 Driver 使用4.6版本。版本兼容详情见 https://www.mongodb.com/docs/drivers/java/sync/current/compatibility
+
+</description>
+
+<table>
+
+## 准备开始
+- 一个可用的 MongoDB 数据库,可以参考以下命令创建测试数据库。
+
+```bash
+use users
+db.users.insert([
+  {"name": "张三", "age": 18},
+  {"name": "李四", "age": 20}
+])
+```
+
+</table>
+
+<codepre id="codepre">
+
+</codepre>
+
+<deploy>
+
+## 部署 & 体验
+
+<appcenter>
+
+- :fire: 通过 [Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-java11-mongodb-http) ,
+[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-java11-mongodb-http)  该应用。 
+
+</appcenter>
+
+- 通过 [Serverless Devs Cli](https://www.serverless-devs.com/serverless-devs/install) 进行部署:
+    - [安装 Serverless Devs Cli 开发者工具](https://www.serverless-devs.com/serverless-devs/install) ,并进行[授权信息配置](https://www.serverless-devs.com/fc/config) ;
+    - 初始化项目:`s init start-java11-mongodb-http -d start-java11-mongodb-http`   
+    - 进入项目,并进行项目部署:`cd start-java11-mongodb-http && s deploy -y`
+
+</deploy>
+
+<appdetail id="flushContent">
+
+# 应用详情
+
+## 初始化参数
+| 参数名称     | 参数类型 | 是否必填 | 例子                                                     | 参数含义           |
+| ------------ | -------- | -------- | -------------------------------------------------------- | ------------------ |
+| serviceName  | String   | 选填     | start-java11-mongodb-http                                | 函数服务名称名     |
+| functionName | String   | 选填     | start-java11-mongodb-http                                | 函数名称           |
+| roleArn      | String   | 必填     | acs:*ram*::\<accountId>:role/aliyuncdnserverlessdevsrole | 函数执行角色       |
+| MONGO_URL     | String   | 必填     | mongodb://xxxxxxxx | MongoDB 数据库地址 |  |
+| MONGO_DATABASE     | String   | 必填     | table-instance                                           | 数据库名         |
+
+### 调用测试
+
+```shell
+# 请求地址为 s deploy 返回的地址
+curl https://******.cn-hangzhou.fcapp.run\?name\=张三
+```
+
+请求收到的响应如下所示:
+
+```bash
+Document{{_id=6306db41f15bf12e96341993, name=张三, age=18.0}
+```
+
+</appdetail>
+
+<devgroup>
+
+## 开发者社区
+
+您如果有关于错误的反馈或者未来的期待,您可以在 [Serverless Devs repo Issues](https://github.com/serverless-devs/serverless-devs/issues) 中进行反馈和交流。如果您想要加入我们的讨论组或者了解 FC 组件的最新动态,您可以通过以下渠道进行:
+
+<p align="center">
+
+| <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407298906_20211028074819117230.png" width="130px" > | <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407044136_20211028074404326599.png" width="130px" > | <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407252200_20211028074732517533.png" width="130px" > |
+| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
+| <center>微信公众号:`serverless`</center>                                                                                         | <center>微信小助手:`xiaojiangwh`</center>                                                                                        | <center>钉钉交流群:`33947367`</center>                                                                                           |
+
+</p>
+
+</devgroup>

+ 91 - 0
mongodb-java-http/publish.yaml

@@ -0,0 +1,91 @@
+# 规范文档参考:
+# 中文:https://github.com/Serverless-Devs/Serverless-Devs/blob/master/spec/zh/0.0.2/serverless_package_model/package_model.md#应用模型规范
+# English: https://github.com/Serverless-Devs/Serverless-Devs/blob/master/spec/en/0.0.2/serverless_package_model/package_model.md#Application-model-specification
+# --------------
+# Package 开发发布最佳实践:
+#   - [社区讨论 #62](https://github.com/Serverless-Devs/Serverless-Devs/discussions/62);
+#   - [社区讨论 #407](https://github.com/Serverless-Devs/Serverless-Devs/discussions/407);
+#   - [社区讨论 #439](https://github.com/Serverless-Devs/Serverless-Devs/discussions/439);
+
+Type: Application
+Name: start-java11-mongodb-http
+Provider:
+  - 阿里云
+Version: 0.0.1
+Description: 函数计算访问MongoDB
+HomePage: https://github.com/devsapp/start-java11-mongodb-http
+Tags: #标签详情
+  - MongoDB
+  - Java
+Category: Web框架
+Service: # 使用的服务
+  函数计算:
+    Authorities:
+      - AliyunFCFullAccess
+Parameters:
+  type: object
+  additionalProperties: false # 不允许增加其他属性
+  required: # 必填项
+    - region
+    - serviceName
+    - functionName
+    - endpoint
+    - tableName
+    - instanceName
+  properties:
+    region:
+      title: 地域
+      type: string
+      default: cn-hangzhou
+      description: 创建应用所在的地区
+      enum:
+        - cn-beijing
+        - cn-hangzhou
+        - cn-shanghai
+        - cn-qingdao
+        - cn-zhangjiakou
+        - cn-huhehaote
+        - cn-shenzhen
+        - cn-chengdu
+        - cn-hongkong
+        - ap-southeast-1
+        - ap-southeast-2
+        - ap-southeast-3
+        - ap-southeast-5
+        - ap-northeast-1
+        - eu-central-1
+        - eu-west-1
+        - us-west-1
+        - us-east-1
+        - ap-south-1
+    roleArn:
+      title: 服务角色
+      type: string
+      default: ''
+      description: 函数执行时所扮演的角色
+      x-role:
+        type: object
+        name: mongodbbackuprole
+        pattern: '^acs:ram::[0-9]*:role/.*$'
+        service: fc
+        description: 应用所属的函数计算服务配置的 role, 请提前创建好对应的 role, 授信函数计算服务, 并配置好 AliyunFCDefaultRolePolicy policy。
+        authorities:
+          - AliyunFCDefaultRolePolicy
+    serviceName:
+      title: 服务名
+      type: string
+      default: start-java11-mongodb-http
+      description: 应用的服务名称
+    functionName:
+      title: 函数名
+      type: string
+      default: start-java11-mongodb-http
+      description: 应用的函数名称
+    MONGO_URL:
+      title: MongoDB 数据库地址
+      type: string
+      description: 数据库所在地址(mongodb://xxxxxx)
+    MONGO_DATABASE:
+      title: 数据库名
+      type: string
+      description: 指定数据库名(users)

+ 2 - 0
mongodb-java-http/src/Makefile

@@ -0,0 +1,2 @@
+release:
+	cd ./code && mvn clean package && cp ./target/QuickStartForMongoDBHttp-1.0-SNAPSHOT.jar ./target/code.jar

+ 103 - 0
mongodb-java-http/src/README.md

@@ -0,0 +1,103 @@
+# start-java11-mongodb-http 帮助文档
+
+<p align="center" class="flex justify-center">
+    <a href="https://www.serverless-devs.com" class="ml-1">
+    <img src="http://editor.devsapp.cn/icon?package=start-java11-mongodb-http&type=packageType">
+  </a>
+  <a href="http://www.devsapp.cn/details.html?name=start-java11-mongodb-http" class="ml-1">
+    <img src="http://editor.devsapp.cn/icon?package=start-java11-mongodb-http&type=packageVersion">
+  </a>
+  <a href="http://www.devsapp.cn/details.html?name=start-java11-mongodb-http" class="ml-1">
+    <img src="http://editor.devsapp.cn/icon?package=start-java11-mongodb-http&type=packageDownload">
+  </a>
+</p>
+
+<description>
+
+本示例为您展示了 Java Runtime 的 MongoDB 使用示例。
+在本示例中,表格存储实例配置在函数的环境变量配置中,initializer 回调函数从环境变量中获取配置,创建 MongoDB 连接,可以实现在整个函数实例生命周期内复用该连接,preStop 回调函数负责关闭 MongoDB 连接。
+
+本示例 Driver 使用4.6版本。版本兼容详情见 https://www.mongodb.com/docs/drivers/java/sync/current/compatibility
+
+</description>
+
+<table>
+
+## 准备开始
+- 一个可用的 MongoDB 数据库,可以参考以下命令创建测试数据库。
+
+```bash
+use users
+db.users.insert([
+  {"name": "张三", "age": 18},
+  {"name": "李四", "age": 20}
+])
+```
+
+</table>
+
+<codepre id="codepre">
+
+</codepre>
+
+<deploy>
+
+## 部署 & 体验
+
+<appcenter>
+
+- :fire: 通过 [Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-java11-mongodb-http) ,
+[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-java11-mongodb-http)  该应用。 
+
+</appcenter>
+
+- 通过 [Serverless Devs Cli](https://www.serverless-devs.com/serverless-devs/install) 进行部署:
+    - [安装 Serverless Devs Cli 开发者工具](https://www.serverless-devs.com/serverless-devs/install) ,并进行[授权信息配置](https://www.serverless-devs.com/fc/config) ;
+    - 初始化项目:`s init start-java11-mongodb-http -d start-java11-mongodb-http`   
+    - 进入项目,并进行项目部署:`cd start-java11-mongodb-http && s deploy -y`
+
+</deploy>
+
+<appdetail id="flushContent">
+
+# 应用详情
+
+## 初始化参数
+| 参数名称     | 参数类型 | 是否必填 | 例子                                                     | 参数含义           |
+| ------------ | -------- | -------- | -------------------------------------------------------- | ------------------ |
+| serviceName  | String   | 选填     | start-java11-mongodb-http                                | 函数服务名称名     |
+| functionName | String   | 选填     | start-java11-mongodb-http                                | 函数名称           |
+| roleArn      | String   | 必填     | acs:*ram*::\<accountId>:role/aliyuncdnserverlessdevsrole | 函数执行角色       |
+| MONGO_URL     | String   | 必填     | mongodb://xxxxxxxx | MongoDB 数据库地址 |  |
+| MONGO_DATABASE     | String   | 必填     | table-instance                                           | 数据库名         |
+
+### 调用测试
+
+```shell
+# 请求地址为 s deploy 返回的地址
+curl https://******.cn-hangzhou.fcapp.run\?name\=张三
+```
+
+请求收到的响应如下所示:
+
+```bash
+Document{{_id=6306db41f15bf12e96341993, name=张三, age=18.0}
+```
+
+</appdetail>
+
+<devgroup>
+
+## 开发者社区
+
+您如果有关于错误的反馈或者未来的期待,您可以在 [Serverless Devs repo Issues](https://github.com/serverless-devs/serverless-devs/issues) 中进行反馈和交流。如果您想要加入我们的讨论组或者了解 FC 组件的最新动态,您可以通过以下渠道进行:
+
+<p align="center">
+
+| <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407298906_20211028074819117230.png" width="130px" > | <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407044136_20211028074404326599.png" width="130px" > | <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407252200_20211028074732517533.png" width="130px" > |
+| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
+| <center>微信公众号:`serverless`</center>                                                                                         | <center>微信小助手:`xiaojiangwh`</center>                                                                                        | <center>钉钉交流群:`33947367`</center>                                                                                           |
+
+</p>
+
+</devgroup>

+ 49 - 0
mongodb-java-http/src/code/dependency-reduced-pom.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>QuickStartForMongoDBHttp</artifactId>
+  <name>QuickStartForMongoDBHttp</name>
+  <version>1.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <filters>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <properties>
+    <maven.compiler.target>11</maven.compiler.target>
+    <maven.test.skip>true</maven.test.skip>
+    <maven.compiler.source>11</maven.compiler.source>
+  </properties>
+</project>

+ 66 - 0
mongodb-java-http/src/code/pom.xml

@@ -0,0 +1,66 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>QuickStartForMongoDBHttp</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>QuickStartForMongoDBHttp</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun.fc.runtime</groupId>
+      <artifactId>fc-java-core</artifactId>
+      <version>1.4.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mongodb</groupId>
+      <artifactId>mongodb-driver-sync</artifactId>
+      <version>4.6.1</version>
+    </dependency>               
+
+  </dependencies>
+
+  <build>
+    <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-shade-plugin</artifactId>
+          <version>3.2.1</version>
+          <executions>
+            <execution>
+              <phase>package</phase>
+              <goals>
+                <goal>shade</goal>
+              </goals>
+              <configuration>
+                <filters>
+                  <filter>
+                    <artifact>*:*</artifact>
+                    <excludes>
+                      <exclude>META-INF/*.SF</exclude>
+                      <exclude>META-INF/*.DSA</exclude>
+                      <exclude>META-INF/*.RSA</exclude>
+                    </excludes>
+                  </filter>
+                </filters>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <maven.compiler.target>11</maven.compiler.target>
+    <maven.compiler.source>11</maven.compiler.source>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+</project>

+ 61 - 0
mongodb-java-http/src/code/src/main/java/example/App.java

@@ -0,0 +1,61 @@
+package example;
+
+import static com.mongodb.client.model.Filters.eq;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.aliyun.fc.runtime.Context;
+import com.mongodb.client.MongoClient;
+import com.mongodb.client.MongoClients;
+import com.mongodb.client.MongoCollection;
+import com.mongodb.client.MongoDatabase;
+import com.aliyun.fc.runtime.FunctionInitializer;
+import com.aliyun.fc.runtime.HttpRequestHandler;
+import com.aliyun.fc.runtime.PreStopHandler;
+
+import org.bson.Document;
+
+public class App implements HttpRequestHandler, FunctionInitializer, PreStopHandler {
+
+	// mongodb://<hostname>:<port>
+	String MONGO_URL = null;
+
+	String MONGO_DATABASE = null;
+
+	private MongoClient mongoClient = null;
+
+	@Override
+	public void initialize(Context context) {
+		// 在initialize回调中创建客户端,可以实现在整个函数实例生命周期内复用该客户端
+		MONGO_URL = System.getenv("MONGO_URL");
+		MONGO_DATABASE = System.getenv("MONGO_DATABASE");
+		mongoClient = MongoClients.create(MONGO_URL);
+	}
+
+	@Override
+	public void preStop(Context context) {
+		mongoClient.close();
+	}
+
+	@Override
+	public void handleRequest(HttpServletRequest request, HttpServletResponse response, Context context)
+			throws IOException {
+		MongoDatabase database = mongoClient.getDatabase(MONGO_DATABASE);
+		MongoCollection<Document> collection = database.getCollection("users");
+
+		Document doc = collection.find(eq("name", request.getParameter("name"))).first();
+
+		context.getLogger().info("get user: " + doc.toString());
+		response.setStatus(200);
+		response.setHeader("Content-Type", "application/json");
+		OutputStream out = response.getOutputStream();
+		out.write(doc.toString().getBytes());
+		out.flush();
+		out.close();
+	}
+
+}

BIN
mongodb-java-http/src/code/target/classes/example/App.class


+ 1 - 0
mongodb-java-http/src/code/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@@ -0,0 +1 @@
+example/App.class

+ 1 - 0
mongodb-java-http/src/code/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@@ -0,0 +1 @@
+/Users/jackd/dev/ai/test-pipeline/mongodb-java-http/src/code/src/main/java/example/App.java

+ 65 - 0
mongodb-java-http/src/s.yaml

@@ -0,0 +1,65 @@
+# ------------------------------------
+#   If you need English case, you can refer to [s_en.yaml] file
+# ------------------------------------
+#   欢迎您使用阿里云函数计算 FC 组件进行项目开发
+#   组件仓库地址:https://github.com/devsapp/fc
+#   组件帮助文档:https://www.serverless-devs.com/fc/readme
+#   Yaml参考文档:https://www.serverless-devs.com/fc/yaml/readme
+#   关于:
+#      - Serverless Devs和FC组件的关系、如何声明/部署多个函数、超过50M的代码包如何部署
+#      - 关于.fcignore使用方法、工具中.s目录是做什么、函数进行build操作之后如何处理build的产物
+#   等问题,可以参考文档:https://www.serverless-devs.com/fc/tips
+#   关于如何做CICD等问题,可以参考:https://www.serverless-devs.com/serverless-devs/cicd
+#   关于如何进行环境划分等问题,可以参考:https://www.serverless-devs.com/serverless-devs/extend
+#   更多函数计算案例,可参考:https://github.com/devsapp/awesome/
+#   有问题快来钉钉群问一下吧:33947367
+# ------------------------------------
+edition: 1.0.0
+name: start-java11-mongodb-http
+# access 是当前应用所需要的密钥信息配置:
+# 密钥配置可以参考:https://www.serverless-devs.com/serverless-devs/command/config
+# 密钥使用顺序可以参考:https://www.serverless-devs.com/serverless-devs/tool#密钥使用顺序与规范
+access: default # 配置密钥信息
+
+vars: # 全局变量
+  region: {{ region }}
+  service:
+    name: {{ serviceName }}
+    description: 'hello world by serverless devs'
+    role: {{ roleArn }}
+
+services:
+  fc-example:
+    component: fc
+    actions:
+      pre-deploy:
+        - run: mvn package
+          path: ./code
+    props:
+      region: ${vars.region} 
+      service: ${vars.service}
+      function:
+        name: {{ functionName }}
+        description: 'hello world by serverless devs'
+        runtime: java11
+        codeUri: ./code/target/QuickStartForMongoDBHttp-1.0-SNAPSHOT.jar
+        handler: example.App::handleRequest
+        memorySize: 256
+        timeout: 600
+        environmentVariables:
+          MONGO_URL: {{ MONGO_URL }} # MongoDB 连接
+          MONGO_DATABASE: {{ MONGO_DATABASE }} # 数据库名
+        initializationTimeout: 60
+        initializer: example.App::initialize
+        instanceLifecycleConfig:
+          preStop:
+            handler: example.App::preStop
+            timeout: 60
+      triggers:  
+        - name: httpTrigger    
+          type: http    
+          config:      
+            authType: anonymous      
+            methods:        
+              - GET
+              - POST

+ 91 - 0
mongodb-java/publish.yaml

@@ -0,0 +1,91 @@
+# 规范文档参考:
+# 中文:https://github.com/Serverless-Devs/Serverless-Devs/blob/master/spec/zh/0.0.2/serverless_package_model/package_model.md#应用模型规范
+# English: https://github.com/Serverless-Devs/Serverless-Devs/blob/master/spec/en/0.0.2/serverless_package_model/package_model.md#Application-model-specification
+# --------------
+# Package 开发发布最佳实践:
+#   - [社区讨论 #62](https://github.com/Serverless-Devs/Serverless-Devs/discussions/62);
+#   - [社区讨论 #407](https://github.com/Serverless-Devs/Serverless-Devs/discussions/407);
+#   - [社区讨论 #439](https://github.com/Serverless-Devs/Serverless-Devs/discussions/439);
+
+Type: Application
+Name: start-java11-mongodb
+Provider:
+  - 阿里云
+Version: 0.0.1
+Description: 函数计算访问MongoDB
+HomePage: https://github.com/devsapp/start-java11-mongodb
+Tags: #标签详情
+  - MongoDB
+  - Java
+Category: Web框架
+Service: # 使用的服务
+  函数计算:
+    Authorities:
+      - AliyunFCFullAccess
+Parameters:
+  type: object
+  additionalProperties: false # 不允许增加其他属性
+  required: # 必填项
+    - region
+    - serviceName
+    - functionName
+    - endpoint
+    - tableName
+    - instanceName
+  properties:
+    region:
+      title: 地域
+      type: string
+      default: cn-hangzhou
+      description: 创建应用所在的地区
+      enum:
+        - cn-beijing
+        - cn-hangzhou
+        - cn-shanghai
+        - cn-qingdao
+        - cn-zhangjiakou
+        - cn-huhehaote
+        - cn-shenzhen
+        - cn-chengdu
+        - cn-hongkong
+        - ap-southeast-1
+        - ap-southeast-2
+        - ap-southeast-3
+        - ap-southeast-5
+        - ap-northeast-1
+        - eu-central-1
+        - eu-west-1
+        - us-west-1
+        - us-east-1
+        - ap-south-1
+    roleArn:
+      title: 服务角色
+      type: string
+      default: ''
+      description: 函数执行时所扮演的角色
+      x-role:
+        type: object
+        name: mongodbbackuprole
+        pattern: '^acs:ram::[0-9]*:role/.*$'
+        service: fc
+        description: 应用所属的函数计算服务配置的 role, 请提前创建好对应的 role, 授信函数计算服务, 并配置好 AliyunFCDefaultRolePolicy policy。
+        authorities:
+          - AliyunFCDefaultRolePolicy
+    serviceName:
+      title: 服务名
+      type: string
+      default: start-java11-mongodb
+      description: 应用的服务名称
+    functionName:
+      title: 函数名
+      type: string
+      default: start-java11-mongodb
+      description: 应用的函数名称
+    MONGO_URL:
+      title: MongoDB 数据库地址
+      type: string
+      description: 数据库所在地址(mongodb://xxxxxx)
+    MONGO_DATABASE:
+      title: 数据库名
+      type: string
+      description: 指定数据库名(users)

+ 117 - 0
mongodb-java/readme.md

@@ -0,0 +1,117 @@
+# start-java11-mongodb 帮助文档
+
+<p align="center" class="flex justify-center">
+    <a href="https://www.serverless-devs.com" class="ml-1">
+    <img src="http://editor.devsapp.cn/icon?package=start-java11-mongodb&type=packageType">
+  </a>
+  <a href="http://www.devsapp.cn/details.html?name=start-java11-mongodb" class="ml-1">
+    <img src="http://editor.devsapp.cn/icon?package=start-java11-mongodb&type=packageVersion">
+  </a>
+  <a href="http://www.devsapp.cn/details.html?name=start-java11-mongodb" class="ml-1">
+    <img src="http://editor.devsapp.cn/icon?package=start-java11-mongodb&type=packageDownload">
+  </a>
+</p>
+
+<description>
+
+本示例为您展示了 Java Runtime 的 MongoDB 使用示例。
+在本示例中,表格存储实例配置在函数的环境变量配置中,initializer 回调函数从环境变量中获取配置,创建 MongoDB 连接,可以实现在整个函数实例生命周期内复用该连接,preStop 回调函数负责关闭 MongoDB 连接。
+
+本示例 Driver 使用4.6版本。版本兼容详情见 https://www.mongodb.com/docs/drivers/java/sync/current/compatibility
+
+</description>
+
+<table>
+
+## 准备开始
+- 一个可用的 MongoDB 数据库,可以参考以下命令创建测试数据库。
+
+```bash
+use users
+db.users.insert([
+  {"name": "张三", "age": 18},
+  {"name": "李四", "age": 20}
+])
+```
+
+</table>
+
+<codepre id="codepre">
+
+</codepre>
+
+<deploy>
+
+## 部署 & 体验
+
+<appcenter>
+
+- :fire: 通过 [Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-java11-mongodb) ,
+[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-java11-mongodb)  该应用。 
+
+</appcenter>
+
+- 通过 [Serverless Devs Cli](https://www.serverless-devs.com/serverless-devs/install) 进行部署:
+    - [安装 Serverless Devs Cli 开发者工具](https://www.serverless-devs.com/serverless-devs/install) ,并进行[授权信息配置](https://www.serverless-devs.com/fc/config) ;
+    - 初始化项目:`s init start-java11-mongodb -d start-java11-mongodb`   
+    - 进入项目,并进行项目部署:`cd start-java11-mongodb && s deploy -y`
+
+</deploy>
+
+<appdetail id="flushContent">
+
+# 应用详情
+
+## 初始化参数
+| 参数名称     | 参数类型 | 是否必填 | 例子                                                     | 参数含义           |
+| ------------ | -------- | -------- | -------------------------------------------------------- | ------------------ |
+| serviceName  | String   | 选填     | start-java11-mongodb                                | 函数服务名称名     |
+| functionName | String   | 选填     | start-java11-mongodb                                | 函数名称           |
+| roleArn      | String   | 必填     | acs:*ram*::\<accountId>:role/aliyuncdnserverlessdevsrole | 函数执行角色       |
+| MONGO_URL     | String   | 必填     | mongodb://xxxxxxxx | MongoDB 数据库地址 |  |
+| MONGO_DATABASE     | String   | 必填     | table-instance                                           | 数据库名         |
+
+### 调用测试
+
+```shell
+s invoke
+```
+
+调用函数时收到的响应如下所示:
+
+```bash
+========= FC invoke Logs begin =========
+FC Invoke Start RequestId: 71946c57-******
+2022-07-12 03:13:22.763 [INFO] [71946c57-10f7-4548-8574-866cfa29c591] get user: Document{{_id=62cb9e5a5c21fd08dbf68490, name=张三, age=18.0}}
+FC Invoke End RequestId: 71946c57-******
+
+Duration: 344.21 ms, Billed Duration: 345 ms, Memory Size: 128 MB, Max Memory Used: 102.32 MB
+========= FC invoke Logs end =========
+
+FC Invoke instanceId: c-62cce588-******
+
+FC Invoke Result:
+Document{{_id=62cb9e5a5c21fd08dbf68490, name=张三, age=18.0}}
+
+
+End of method: invoke
+
+```
+
+</appdetail>
+
+<devgroup>
+
+## 开发者社区
+
+您如果有关于错误的反馈或者未来的期待,您可以在 [Serverless Devs repo Issues](https://github.com/serverless-devs/serverless-devs/issues) 中进行反馈和交流。如果您想要加入我们的讨论组或者了解 FC 组件的最新动态,您可以通过以下渠道进行:
+
+<p align="center">
+
+| <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407298906_20211028074819117230.png" width="130px" > | <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407044136_20211028074404326599.png" width="130px" > | <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407252200_20211028074732517533.png" width="130px" > |
+| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
+| <center>微信公众号:`serverless`</center>                                                                                         | <center>微信小助手:`xiaojiangwh`</center>                                                                                        | <center>钉钉交流群:`33947367`</center>                                                                                           |
+
+</p>
+
+</devgroup>

+ 2 - 0
mongodb-java/src/Makefile

@@ -0,0 +1,2 @@
+release:
+	cd ./code && mvn clean package && cp ./target/QuickStartForMongoDB-1.0-SNAPSHOT.jar ./target/code.jar

+ 117 - 0
mongodb-java/src/README.md

@@ -0,0 +1,117 @@
+# start-java11-mongodb 帮助文档
+
+<p align="center" class="flex justify-center">
+    <a href="https://www.serverless-devs.com" class="ml-1">
+    <img src="http://editor.devsapp.cn/icon?package=start-java11-mongodb&type=packageType">
+  </a>
+  <a href="http://www.devsapp.cn/details.html?name=start-java11-mongodb" class="ml-1">
+    <img src="http://editor.devsapp.cn/icon?package=start-java11-mongodb&type=packageVersion">
+  </a>
+  <a href="http://www.devsapp.cn/details.html?name=start-java11-mongodb" class="ml-1">
+    <img src="http://editor.devsapp.cn/icon?package=start-java11-mongodb&type=packageDownload">
+  </a>
+</p>
+
+<description>
+
+本示例为您展示了 Java Runtime 的 MongoDB 使用示例。
+在本示例中,表格存储实例配置在函数的环境变量配置中,initializer 回调函数从环境变量中获取配置,创建 MongoDB 连接,可以实现在整个函数实例生命周期内复用该连接,preStop 回调函数负责关闭 MongoDB 连接。
+
+本示例 Driver 使用4.6版本。版本兼容详情见 https://www.mongodb.com/docs/drivers/java/sync/current/compatibility
+
+</description>
+
+<table>
+
+## 准备开始
+- 一个可用的 MongoDB 数据库,可以参考以下命令创建测试数据库。
+
+```bash
+use users
+db.users.insert([
+  {"name": "张三", "age": 18},
+  {"name": "李四", "age": 20}
+])
+```
+
+</table>
+
+<codepre id="codepre">
+
+</codepre>
+
+<deploy>
+
+## 部署 & 体验
+
+<appcenter>
+
+- :fire: 通过 [Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-java11-mongodb) ,
+[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-java11-mongodb)  该应用。 
+
+</appcenter>
+
+- 通过 [Serverless Devs Cli](https://www.serverless-devs.com/serverless-devs/install) 进行部署:
+    - [安装 Serverless Devs Cli 开发者工具](https://www.serverless-devs.com/serverless-devs/install) ,并进行[授权信息配置](https://www.serverless-devs.com/fc/config) ;
+    - 初始化项目:`s init start-java11-mongodb -d start-java11-mongodb`   
+    - 进入项目,并进行项目部署:`cd start-java11-mongodb && s deploy -y`
+
+</deploy>
+
+<appdetail id="flushContent">
+
+# 应用详情
+
+## 初始化参数
+| 参数名称     | 参数类型 | 是否必填 | 例子                                                     | 参数含义           |
+| ------------ | -------- | -------- | -------------------------------------------------------- | ------------------ |
+| serviceName  | String   | 选填     | start-java11-mongodb                                | 函数服务名称名     |
+| functionName | String   | 选填     | start-java11-mongodb                                | 函数名称           |
+| roleArn      | String   | 必填     | acs:*ram*::\<accountId>:role/aliyuncdnserverlessdevsrole | 函数执行角色       |
+| MONGO_URL     | String   | 必填     | mongodb://xxxxxxxx | MongoDB 数据库地址 |  |
+| MONGO_DATABASE     | String   | 必填     | table-instance                                           | 数据库名         |
+
+### 调用测试
+
+```shell
+s invoke
+```
+
+调用函数时收到的响应如下所示:
+
+```bash
+========= FC invoke Logs begin =========
+FC Invoke Start RequestId: 71946c57-******
+2022-07-12 03:13:22.763 [INFO] [71946c57-10f7-4548-8574-866cfa29c591] get user: Document{{_id=62cb9e5a5c21fd08dbf68490, name=张三, age=18.0}}
+FC Invoke End RequestId: 71946c57-******
+
+Duration: 344.21 ms, Billed Duration: 345 ms, Memory Size: 128 MB, Max Memory Used: 102.32 MB
+========= FC invoke Logs end =========
+
+FC Invoke instanceId: c-62cce588-******
+
+FC Invoke Result:
+Document{{_id=62cb9e5a5c21fd08dbf68490, name=张三, age=18.0}}
+
+
+End of method: invoke
+
+```
+
+</appdetail>
+
+<devgroup>
+
+## 开发者社区
+
+您如果有关于错误的反馈或者未来的期待,您可以在 [Serverless Devs repo Issues](https://github.com/serverless-devs/serverless-devs/issues) 中进行反馈和交流。如果您想要加入我们的讨论组或者了解 FC 组件的最新动态,您可以通过以下渠道进行:
+
+<p align="center">
+
+| <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407298906_20211028074819117230.png" width="130px" > | <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407044136_20211028074404326599.png" width="130px" > | <img src="https://serverless-article-picture.oss-cn-hangzhou.aliyuncs.com/1635407252200_20211028074732517533.png" width="130px" > |
+| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
+| <center>微信公众号:`serverless`</center>                                                                                         | <center>微信小助手:`xiaojiangwh`</center>                                                                                        | <center>钉钉交流群:`33947367`</center>                                                                                           |
+
+</p>
+
+</devgroup>

+ 49 - 0
mongodb-java/src/code/dependency-reduced-pom.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>QuickStartForMongoDB</artifactId>
+  <name>QuickStartForMongoDB</name>
+  <version>1.0-SNAPSHOT</version>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <filters>
+                <filter>
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <properties>
+    <maven.compiler.target>11</maven.compiler.target>
+    <maven.test.skip>true</maven.test.skip>
+    <maven.compiler.source>11</maven.compiler.source>
+  </properties>
+</project>

+ 66 - 0
mongodb-java/src/code/pom.xml

@@ -0,0 +1,66 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>example</groupId>
+  <artifactId>QuickStartForMongoDB</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0-SNAPSHOT</version>
+  <name>QuickStartForMongoDB</name>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.aliyun.fc.runtime</groupId>
+      <artifactId>fc-java-core</artifactId>
+      <version>1.4.1</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.mongodb</groupId>
+      <artifactId>mongodb-driver-sync</artifactId>
+      <version>4.6.1</version>
+    </dependency>               
+
+  </dependencies>
+
+  <build>
+    <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-shade-plugin</artifactId>
+          <version>3.2.1</version>
+          <executions>
+            <execution>
+              <phase>package</phase>
+              <goals>
+                <goal>shade</goal>
+              </goals>
+              <configuration>
+                <filters>
+                  <filter>
+                    <artifact>*:*</artifact>
+                    <excludes>
+                      <exclude>META-INF/*.SF</exclude>
+                      <exclude>META-INF/*.DSA</exclude>
+                      <exclude>META-INF/*.RSA</exclude>
+                    </excludes>
+                  </filter>
+                </filters>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <maven.compiler.target>11</maven.compiler.target>
+    <maven.compiler.source>11</maven.compiler.source>
+    <maven.test.skip>true</maven.test.skip>
+  </properties>
+</project>

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov