使用气流SQSSENSOR轮询多个SQS消息
我正在使用此SQSSENSOE设置进行民意调查消息,
fetch_sqs_message = SQSSensor(
task_id="...",
sqs_queue="...",
aws_conn_id="aws_default",
max_messages=10,
wait_time_seconds=30,
poke_interval=60,
timeout=300,
dag=dag
)
我会假设每次轮询时都应进行投票多达10条消息。我的队列在我测试时大约有5个。 但是,每次我触发DAG时,一次只会轮询1消息,我从SQS消息数中发现了这一点。 为什么这样做?我该如何使IT调查尽可能多?
I am using this SQSSensoe settings to poll messages
fetch_sqs_message = SQSSensor(
task_id="...",
sqs_queue="...",
aws_conn_id="aws_default",
max_messages=10,
wait_time_seconds=30,
poke_interval=60,
timeout=300,
dag=dag
)
I would assume everytime it polls it should poll up to 10 messages. Which my queue has around 5 when I tested this.
But each time I trigger the dag, it only polls 1 message at a time, which I found out from the SQS message count.
Why is it doing this? How can I to get it poll as much messages as possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最近,已将一项新功能添加到
sqssensor
中,以便传感器可以多次对SQS进行轮询,而不是仅一次。您可以查看此合并PR
例如,如果
>
num_batches
设置为3,sqssensor
将在返回结果之前将队列轮询3次。免责声明:我为此功能做出了贡献。
Recently, a new feature has been added to
SQSSensor
so that the sensor can polls SQS multiple times instead of only once.You can check out this merged PR
For example, if
num_batches
is set to 3,SQSSensor
will poll the queue 3 times before returning the results.Disclaimer: I contributed to this feature.