vincbeck commented on code in PR #54651: URL: https://github.com/apache/airflow/pull/54651#discussion_r2298438611
########## providers/amazon/src/airflow/providers/amazon/aws/queues/sqs.py: ########## @@ -38,7 +38,66 @@ class SqsMessageQueueProvider(BaseMessageQueueProvider): - """Configuration for SQS integration with common-messaging.""" + """ + Configuration for SQS integration with common-messaging. + + [START sqs_message_queue_provider_description] + + **Scheme-based Usage (Recommended)**: + + * It uses the ``sqs`` as scheme for identifying SQS queues. + * For parameter definitions take a look at :class:`~airflow.providers.amazon.aws.triggers.sqs.SqsSensorTrigger`. + + .. code-block:: python + + from airflow.providers.common.messaging.triggers.msg_queue import MessageQueueTrigger + from airflow.sdk import Asset, AssetWatcher + + # New scheme-based approach + trigger = MessageQueueTrigger( + scheme="sqs", + # Additional AWS SqsSensorTrigger parameters as needed + sqs_queue="https://sqs.us-east-1.amazonaws.com/123456789012/my-queue", + aws_conn_id="aws_default", + ) + + asset = Asset("sqs_queue_asset", watchers=[AssetWatcher(name="sqs_watcher", trigger=trigger)]) + + **URI Format (Deprecated)**: + + .. warning:: + + * The ``queue`` parameter is deprecated and will be removed in future versions. + * Use the ``scheme`` parameter with appropriate keyword arguments instead. + + .. code-block:: text + + https://sqs.<region>.amazonaws.com/<account_id>/<queue_name> + + Where: + + * ``region``: AWS region where the SQS queue is located + * ``account_id``: AWS account ID + * ``queue_name``: Name of the SQS queue + + **Examples (Deprecated)**: Review Comment: If we go that way I'll be in favor of not providing an example with the deprecated `queue`. Not documenting a deprecated way of doing things is the best strategy to avoid users keep using it :) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
