使用气流SQSSENSOR轮询多个SQS消息

发布于 2025-02-04 03:41:43 字数 408 浏览 1 评论 0原文

我正在使用此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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情释 2025-02-11 03:41:43

最近,已将一项新功能添加到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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文