airflow.providers.amazon.aws.operators.sqs

向 SQS 佇列釋出訊息。

SqsPublishOperator

向 Amazon SQS 佇列釋出訊息。

模組內容

class airflow.providers.amazon.aws.operators.sqs.SqsPublishOperator(*, sqs_queue, message_content, message_attributes=None, delay_seconds=0, message_group_id=None, message_deduplication_id=None, **kwargs)[source]

基類: airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator[airflow.providers.amazon.aws.hooks.sqs.SqsHook]

向 Amazon SQS 佇列釋出訊息。

另請參閱

有關如何使用此運算子的更多資訊,請參閱指南: 向 Amazon SQS 佇列釋出訊息

引數:
  • sqs_queue (str) – SQS 佇列 URL(模板化)

  • message_content (str) – 訊息內容(模板化)

  • message_attributes (dict | None) – 訊息的附加屬性(預設:None)。有關屬性引數的詳細資訊,請參閱 botocore.client.SQS.send_message()

  • delay_seconds (int) – 訊息延遲(模板化)(預設:0 秒)

  • message_group_id (str | None) – 此引數僅適用於 FIFO(先進先出)佇列。(預設:None)。有關屬性引數的詳細資訊,請參閱 botocore.client.SQS.send_message()

  • message_deduplication_id (str | None) – 此引數僅適用於 FIFO(先進先出)佇列。有關屬性引數的詳細資訊,請參閱 botocore.client.SQS.send_message()

  • aws_conn_id – 用於 AWS 憑據的 Airflow 連線。如果此引數為 None 或為空,則使用預設的 boto3 行為。如果 Airflow 以分散式方式執行且 aws_conn_id 為 None 或為空,則將使用預設的 boto3 配置(並且必須在每個工作節點上維護)。

  • region_name – AWS 區域名稱。如果未指定,則使用預設的 boto3 行為。

  • verify – 是否驗證 SSL 證書。請參閱: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html

  • botocore_config – botocore 客戶端的配置字典(鍵值對)。請參閱: https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html

aws_hook_class[source]
template_fields: collections.abc.Sequence[str][source]
template_fields_renderers[source]
ui_color = '#6ad3fa'[source]
sqs_queue[source]
message_content[source]
delay_seconds = 0[source]
message_attributes[source]
message_group_id = None[source]
message_deduplication_id = None[source]
execute(context)[source]

將訊息釋出到 Amazon SQS 佇列。

引數:

context (airflow.utils.context.Context) – 上下文物件

返回值:

包含傳送訊息資訊的字典。有關返回字典的詳細資訊,請參閱 botocore.client.SQS.send_message()

返回值型別:

dict

此條目是否有幫助?