java - 如何在function.json中设置isSessionsEnabled = true?
问题描述
当我构建 Azure Function (Java) 的以下代码时,生成的 function.json 中未设置 isSessionsEnabled。
如何在function.json中设置isSessionsEnabled = true?
该构建使用 Gradle。
public class Function {
@FunctionName("FunctionApp")
public void run(
@ServiceBusQueueTrigger(
name = "TriggerName",
queueName = "queueName",
connection = "ConnectionString",
isSessionsEnabled = true
) String message,
ExecutionContext context
) {
}
}
- 函数.json
{
"scriptFile" : "../func.jar",
"entryPoint" : "test.Function.run",
"bindings" : [ {
"type" : "serviceBusTrigger",
"direction" : "in",
"name" : "message",
"queueName" : "queueName",
"connection" : "ConnectionString"
} ]
}
解决方案
如何在function.json中设置isSessionsEnabled = true?
从服务总线触发器扩展版本 3.1.0 开始,您可以在启用会话的队列或主题上触发。
您可以在function.json 中添加isSessionsEnabled =true 。
{
"scriptFile" : "../func.jar",
"entryPoint" : "test.Function.run",
"bindings" : [ {
"type" : "serviceBusTrigger",
"direction" : "in",
"name" : "message",
"queueName" : "queueName",
"connection" : "ConnectionString",
"isSessionsEnabled" : true
} ]
}
以下是您可以添加到function.json文件的配置属性列表。
推荐阅读
- javascript - 如果我的配置文件将其设置为关闭,如何清除间隔
- c# - 循环遍历 HtmlNodes 并收集数据每次都会给我相同的结果
- text-mining - 我在哪里可以找到 r 中的相干函数?
- javascript - 将标题放入反应中时遇到问题
- asp.net-core - 如何在.net core web 中使用 Json() 函数?
- c# - Jasmin SMS 工具是否有我可以使用的 API 来扩展和构建我想要的 SMS 网关服务?
- php - “无法打开文件进行阅读”将 PDF 从存储附加到可邮寄
- api - Shopify Graphql 代码返回错误 404。还注意到它适用于 .myshopify 域但不适用于自定义
- objective-c - UITextField 占位符文本在 iOS13 暗模式下不可读
- python - Python 3 无法识别 nmap 模块我在这里做错了什么?