-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathRetrieveOrder.java
More file actions
48 lines (44 loc) · 1.72 KB
/
RetrieveOrder.java
File metadata and controls
48 lines (44 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package main.java.com.function;
import com.microsoft.azure.functions.ExecutionContext;
import com.microsoft.azure.functions.HttpMethod;
import com.microsoft.azure.functions.HttpRequestMessage;
import com.microsoft.azure.functions.HttpResponseMessage;
import com.microsoft.azure.functions.HttpStatus;
import com.microsoft.azure.functions.annotation.AuthorizationLevel;
import com.microsoft.azure.functions.annotation.FunctionName;
import com.microsoft.azure.functions.annotation.HttpTrigger;
import com.microsoft.azure.functions.dapr.annotation.DaprServiceInvocationTrigger;
import com.microsoft.azure.functions.dapr.annotation.DaprStateInput;
import com.microsoft.azure.functions.dapr.annotation.DaprStateOutput;
import com.microsoft.azure.functions.OutputBinding;
import java.util.Optional;
import java.util.logging.Logger;
/**
* Azure Functions with HTTP Trigger.
*/
public class RetrieveOrder {
/**
* This function gets invoked by dapr runtime:
* dapr invoke --app-id functionapp --method RetrieveOrder
*/
@FunctionName("RetrieveOrder")
public String run(
@DaprServiceInvocationTrigger(
methodName = "RetrieveOrder")
String payload,
@DaprStateInput(
stateStore = "%StateStoreName%",
key = "order")
String product,
final ExecutionContext context) {
Logger logger = context.getLogger();
logger.info("Java function processed a RetrieveOrder request from the Dapr Runtime.");
logger.info(product);
return product;
}
}