|
|
1 месяц назад | |
|---|---|---|
| .. | ||
| src | 1 месяц назад | |
| README-en.md | 1 месяц назад | |
| README.md | 1 месяц назад | |
| publish.yaml | 1 месяц назад | |
Using this item, verify that your operational account has the following product permissions/policies:
| Service/Business | Functional Computing |
|---|---|
| Permissions/Policies | AliyunFCFullAccess |
Deploy via Serverless Devs Cli:
s init timer-trigger-fc-event-java11 -d timer-trigger-fc-event-java11cd timer-trigger-fc-event-java11 && s deploy -ylocal debugging
s invoke --event-file event-example/timer-fc-sample.json.You can view the logs and results after the simulated event triggers the function.
========= FC invoke Logs begin =========
FC Invoke Start RequestId: 7564db25-615e-4952-845a-9f923c33bc6b
[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 [d4d9f0d4] (normal mode)
2022-08-03 13:39:30.816 [INFO] [7564db25-615e-4952-845a-9f923c33bc6b] triggerTime: 2022-07-29T10:02:58Z
2022-08-03 13:39:30.816 [INFO] [7564db25-615e-4952-845a-9f923c33bc6b] triggerName: TestTimer
2022-08-03 13:39:30.817 [INFO] [7564db25-615e-4952-845a-9f923c33bc6b] payload: TestPayload
FC Invoke End RequestId: 7564db25-615e-4952-845a-9f923c33bc6b
Duration: 222.05 ms, Billed Duration: 223 ms, Memory Size: 128 MB, Max Memory Used: 82.52 MB
========= FC invoke Logs end =========
FC Invoke instanceId: c-62ea7a92-1ae386bb6d88454b9f58
FC Invoke Result:
Timer Payload: TestPayload
End of method: invoke
````
- End-to-end testing
- Log in to the Function Compute console, find the function you just deployed, and view the `call log` (if the log is not activated, click one-click activation), and you can view that the function trigger log is triggered and printed at the corresponding time interval.
The log is as follows:
bash
c-62ea7b02-22d488e6b6-08-03 21:43:22FC Invoke Start RequestId: c7439fac-9c76-45f3-98e6-ae535f0d5e
c-62ea7b02-22d488e6b6-08-03 21:43:22[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 d4d9f0d4
c-62ea7b02-22d488e6b6-08-03 21:43:222022-08-03 13:43:22.568 [INFO] [c7439fac-9c76-45f3-98e6-ae535f0d5e] triggerTime: 2022-08-03T1Z: 2022-08-03
c-62ea7b02-22d488e6b6-08-03 21:43:222022-08-03 13:43:22.568 [INFO] [c7439fac-9c76-45f3-98e6-ae535f0d5e] triggerName: timer
c-62ea7b02-22d488e6b6-08-03 21:43:222022-08-03 13:43:22.568 [INFO] [c7439fac-9c76-45f3-98e6-ae535f0d5e] payload: TestPayload
c-62ea7b02-22d488e6b6-08-03 21:43:22FC Invoke End RequestId
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.
If you have feedback about bugs or future expectations, you can give feedback and exchange in Serverless Devs repo Issues. If you want to join our discussion group or keep up to date with the latest developments in FC components, you can do so through the following channels:
|
|
|
|
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| WeChat public account:`serverless` | WeChat assistant: `xiaojiangwh` | Dingding exchange group:`33947367` |