@Retention(value=RUNTIME) @Target(value=PARAMETER) public @interface ServiceBusTopicTrigger
Place this on a parameter whose value would come from Service Bus topic, and causing the method to run when a new item is published. The parameter type can be one of the following:
The following example shows a service bus topic trigger which logs the message:
@FunctionName("sbprocessor")
public void serviceBusProcess(
@ServiceBusTopicTrigger(name = "msg",
topicName = "mytopicname",
subscriptionName = "mysubname",
connection = "myconnvarname") String message,
final ExecutionContext context
) {
context.getLogger().info(message);
}
| Modifier and Type | Required Element and Description |
|---|---|
String |
connection
Defines the app setting name that contains the Service Bus connection string.
|
String |
name
The variable name used in function.json.
|
String |
subscriptionName
Defines the subscription name of the Service Bus topic to which to bind.
|
String |
topicName
Defines the name of the Service Bus topic to which to bind.
|
| Modifier and Type | Optional Element and Description |
|---|---|
AccessRights |
access
Defines the permission of the Service Bus topic to which to bind.
|
Cardinality |
cardinality
Cardinality of the trigger input.
|
String |
dataType
Defines how Functions runtime should treat the parameter value.
|
boolean |
isSessionsEnabled
Defines the value indicating whether the sessions are enabled.
|
public abstract String name
public abstract String topicName
public abstract String subscriptionName
public abstract String connection
public abstract String dataType
Defines how Functions runtime should treat the parameter value. Possible values are:
public abstract AccessRights access
public abstract boolean isSessionsEnabled
public abstract Cardinality cardinality
Cardinality value representing the CardinalityCopyright © 2022. All rights reserved.