【问题标题】:How to make Timer Trigger call the Queue Trigger with the help of the queue messages?如何在队列消息的帮助下使 Timer Trigger 调用 Queue Trigger?
【发布时间】:2021-12-08 13:59:50
【问题描述】:

例如, 我有 2 个队列触发器,它们将由 Timer Trigger 函数中队列触发器的 2 条不同消息调用。如何调用计时器中的触发器并自动发送消息,以便在触发 Timer 功能时,它会使用 python 语言自动将消息发送到相应的队列?

提前致谢。

【问题讨论】:

    标签: azure-functions azure-triggers timer-trigger queuetrigger


    【解决方案1】:

    下面是Timer trigger调用队列触发函数的示例代码。

    host.json

    {
      "version": "2.0",
      "logging": {
        "applicationInsights": {
          "samplingSettings": {
            "isEnabled": true,
            "excludedTypes": "Request"
          }
        }
      },
      "extensionBundle": {
        "id": "Microsoft.Azure.Functions.ExtensionBundle",
        "version": "[1.*, 2.0.0)"
      }
    }
    

    函数.json

    {
      "scriptFile": "__init__.py",
      "bindings": [
        {
          "name": "mytimer",
          "type": "timerTrigger",
          "direction": "in",
          "schedule": "*/20 * * * * *"
        }
      ]
    }
    

    更多信息请查看相关的SO1SO2

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-21
      • 2013-05-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-18
      相关资源
      最近更新 更多