我有一个队列触发器,它读取gis特性层并在它写回门户时处理它。它似乎正常工作,除非消息没有登录到外部队列。我说它可以正常工作,因为我可以看到gis特性保护器正确地写在gis门户上。我想我的装订不太好。我不一定需要将结果数据写入回。我所需要的只是保存在外部队列上的任何消息,以便为其他进程提供资源。为了隐私起见,不能在这里发布完整的代码,但是我的主文件(init_py)可以被认为是:
import logging
import json
import pandas
def main(msg: func.QueueMessage, msg1: func.Out[str]) -> None:
logging.info('Python queue trigger function processed a queue item: %s',
msg.get_body().decode('utf-8'))
x=1
y=1
df=x=1
msg1.set(df)我的function.host
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "msg",
"type": "queueTrigger",
"direction": "in",
"queueName": "outqueue12",
"connection": "storageaccountautom92bb_STORAGE"
},
{
"type": "http",
"direction": "out",
"name": "$return"
},
{
"type": "queue",
"direction": "out",
"name": "msg1",
"queueName": "outqueue13",
"connection": "AzureStorageQueuesConnectionString"
}
]
}发布于 2020-12-22 08:38:20
绑定接受字符串类型和字节类型,因此下面的代码应该可以工作:
__init__.py
import logging
import azure.functions as func
def main(msg: func.QueueMessage, msg2: func.Out[str]) -> None:
num1 = 1
num2 = 1
str1 = num1+num2
msg2.set(str(str1))function.json
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "msg",
"type": "queueTrigger",
"direction": "in",
"queueName": "test1",
"connection": "0730bowmanwindow_STORAGE"
},
{
"type": "queue",
"direction": "out",
"name": "msg2",
"queueName": "test2",
"connection": "0730bowmanwindow_STORAGE"
}
]
}https://stackoverflow.com/questions/65405476
复制相似问题