@Retention(value=RUNTIME) @Target(value={PARAMETER,METHOD}) public @interface EventHubOutput
Place this on a parameter whose value would be published to the event hub. The parameter type should be OutputBinding<T>, where T could be one of:
The following example shows a Java function that writes a message to an event hub:
@FunctionName("sendTime")
@EventHubOutput(name = "event", eventHubName = "samples-workitems", connection = "AzureEventHubConnection")
public String sendTime(
@TimerTrigger(name = "sendTimeTrigger", schedule = "0 */5 * * * *") String timerInfo
) {
return LocalDateTime.now().toString();
}| 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 publish.
|
String |
name
The variable name used in function.json.
|
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:
Copyright © 2022. All rights reserved.