DurableClientInput Interface
Implements
public interface DurableClientInput
implements java.lang.annotation.Annotation
Azure Functions attribute for binding a function parameter to a @DurableClientContext object.
The following is an example of an HTTP-trigger function that uses this input binding to start a new orchestration instance.
@FunctionName("StartHelloCities")
public HttpResponseMessage startHelloCities(
@HttpTrigger(name = "request", methods = {HttpMethod.GET, HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage> request,
@DurableClientInput(name = "durableContext") DurableClientContext durableContext,
final ExecutionContext context) {
DurableTaskClient client = durableContext.getClient();
String instanceId = client.scheduleNewOrchestrationInstance("HelloCities");
context.getLogger().info("Created new Java orchestration with instance ID = " + instanceId);
return durableContext.createCheckStatusResponse(request, instanceId);
}
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| abstract java.lang.String |
dataType()
Defines how Functions runtime should treat the parameter value. |
| abstract java.lang.String |
name()
The variable name used in function. |
| abstract java.lang.String |
taskHub()
Optional. |
Method Details
dataType
public abstract String dataType()
Defines how Functions runtime should treat the parameter value. Possible values are:
- "": get the value as a string, and try to deserialize to actual parameter type like POJO
- string: always get the value as a string
- binary: get the value as a binary data, and try to deserialize to actual parameter type byte[]
Returns:
name
public abstract String name()
The variable name used in function.json.
Returns:
taskHub
public abstract String taskHub()
Optional. The name of the task hub in which the orchestration data lives.
If not specified, the task hub name used by this binding will be the value specified in host.json. If a task hub name is not configured in host.json and if the function app is running in the Azure Functions hosted service, then task hub name is derived from the function app's name. Otherwise, a constant value is used for the task hub name.
In general, you should not set a value for the task hub name here unless you intend to configure the client to interact with orchestrations in another app.
Returns: