@Retention(value=RUNTIME) @Target(value=PARAMETER) public @interface EventHubTrigger
Place this on a parameter whose value would come from event hub, and causing the method to run when a new event is arrived. The parameter type can be one of the following:
The following example shows a Java function that logs the message body of the event hub trigger:
@FunctionName("eventHubMonitor")
public void logEventHubMessage(
@EventHubTrigger(name = "event",
eventHubName = "samples-workitems",
connection = "AzureEventHubConnection") String message,
final ExecutionContext context
) {
context.getLogger().info("Event hub message received: " + message);
}| Modifier and Type | Required Element and Description |
|---|---|
String |
connection
Defines the app setting name that contains the Azure Eventhub connection string.
|
String |
eventHubName
Defines the name of the event hub to which to bind.
|
String |
name
The variable name used in function.json.
|
| Modifier and Type | Optional Element and Description |
|---|---|
Cardinality |
cardinality
Cardinality of the trigger input.
|
String |
consumerGroup
Defines the consumer group of the event hub to which to bind.
|
String |
dataType
Defines how Functions runtime should treat the parameter value.
|
public abstract String name
public abstract String eventHubName
public abstract String connection
public abstract String dataType
Defines how Functions runtime should treat the parameter value. Possible values are:
public abstract Cardinality cardinality
Cardinality value representing the Cardinalitypublic abstract String consumerGroup
Copyright © 2022. All rights reserved.