airflow.providers.microsoft.azure.operators.asb

Module Contents

Classes

AzureServiceBusCreateQueueOperator

Creates a Azure Service Bus queue under a Service Bus Namespace by using ServiceBusAdministrationClient

AzureServiceBusSendMessageOperator

Send Message or batch message to the Service Bus queue

AzureServiceBusReceiveMessageOperator

Receive a batch of messages at once in a specified Queue name

AzureServiceBusDeleteQueueOperator

Deletes the Queue in the Azure Service Bus namespace

AzureServiceBusTopicCreateOperator

Create an Azure Service Bus Topic under a Service Bus Namespace by using ServiceBusAdministrationClient

AzureServiceBusSubscriptionCreateOperator

Create an Azure Service Bus Topic Subscription under a Service Bus Namespace

AzureServiceBusUpdateSubscriptionOperator

Update an Azure ServiceBus Topic Subscription under a ServiceBus Namespace

ASBReceiveSubscriptionMessageOperator

Receive a Batch messages from a Service Bus Subscription under specific Topic.

AzureServiceBusSubscriptionDeleteOperator

Deletes the topic subscription in the Azure ServiceBus namespace

AzureServiceBusTopicDeleteOperator

Deletes the topic in the Azure Service Bus namespace

class airflow.providers.microsoft.azure.operators.asb.AzureServiceBusCreateQueueOperator(*, queue_name, max_delivery_count=10, dead_lettering_on_message_expiration=True, enable_batched_operations=True, azure_service_bus_conn_id='azure_service_bus_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

Creates a Azure Service Bus queue under a Service Bus Namespace by using ServiceBusAdministrationClient

See also

For more information on how to use this operator, take a look at the guide: Create Azure Service Bus Queue

Parameters
  • queue_name (str) – The name of the queue. should be unique.

  • max_delivery_count (int) – The maximum delivery count. A message is automatically dead lettered after this number of deliveries. Default value is 10..

  • dead_lettering_on_message_expiration (bool) – A value that indicates whether this subscription has dead letter support when a message expires.

  • enable_batched_operations (bool) – Value that indicates whether server-side batched operations are enabled.

  • azure_service_bus_conn_id (str) – Reference to the Azure Service Bus connection.

template_fields :Sequence[str] = ['queue_name'][source]
ui_color = #e4f0e8[source]
execute(context)[source]

Creates Queue in Azure Service Bus namespace, by connecting to Service Bus Admin client in hook

class airflow.providers.microsoft.azure.operators.asb.AzureServiceBusSendMessageOperator(*, queue_name, message, batch=False, azure_service_bus_conn_id='azure_service_bus_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

Send Message or batch message to the Service Bus queue

See also

For more information on how to use this operator, take a look at the guide: Send Message to Azure Service Bus Queue

Parameters
  • queue_name (str) – The name of the queue. should be unique.

  • message (str | list[str]) – Message which needs to be sent to the queue. It can be string or list of string.

  • batch (bool) – Its boolean flag by default it is set to False, if the message needs to be sent as batch message it can be set to True.

  • azure_service_bus_conn_id (str) – Reference to the :ref: Azure Service Bus connection<howto/connection:azure_service_bus>.

template_fields :Sequence[str] = ['queue_name'][source]
ui_color = #e4f0e8[source]
execute(context)[source]

Sends Message to the specific queue in Service Bus namespace, by connecting to Service Bus client

class airflow.providers.microsoft.azure.operators.asb.AzureServiceBusReceiveMessageOperator(*, queue_name, azure_service_bus_conn_id='azure_service_bus_default', max_message_count=10, max_wait_time=5, **kwargs)[source]

Bases: airflow.models.BaseOperator

Receive a batch of messages at once in a specified Queue name

See also

For more information on how to use this operator, take a look at the guide: Receive Message Azure Service Bus Queue

Parameters
  • queue_name (str) – The name of the queue name or a QueueProperties with name.

  • max_message_count (int) – Maximum number of messages in the batch.

  • max_wait_time (float) – Maximum time to wait in seconds for the first message to arrive.

  • azure_service_bus_conn_id (str) – Reference to the :ref: Azure Service Bus connection <howto/connection:azure_service_bus>.

template_fields :Sequence[str] = ['queue_name'][source]
ui_color = #e4f0e8[source]
execute(context)[source]

Receive Message in specific queue in Service Bus namespace, by connecting to Service Bus client

class airflow.providers.microsoft.azure.operators.asb.AzureServiceBusDeleteQueueOperator(*, queue_name, azure_service_bus_conn_id='azure_service_bus_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

Deletes the Queue in the Azure Service Bus namespace

See also

For more information on how to use this operator, take a look at the guide: Delete Azure Service Bus Queue

Parameters
  • queue_name (str) – The name of the queue in Service Bus namespace.

  • azure_service_bus_conn_id (str) – Reference to the :ref: Azure Service Bus connection <howto/connection:azure_service_bus>.

template_fields :Sequence[str] = ['queue_name'][source]
ui_color = #e4f0e8[source]
execute(context)[source]

Delete Queue in Service Bus namespace, by connecting to Service Bus Admin client

class airflow.providers.microsoft.azure.operators.asb.AzureServiceBusTopicCreateOperator(*, topic_name, azure_service_bus_conn_id='azure_service_bus_default', default_message_time_to_live=None, max_size_in_megabytes=None, requires_duplicate_detection=None, duplicate_detection_history_time_window=None, enable_batched_operations=None, size_in_bytes=None, filtering_messages_before_publishing=None, authorization_rules=None, support_ordering=None, auto_delete_on_idle=None, enable_partitioning=None, enable_express=None, user_metadata=None, max_message_size_in_kilobytes=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Create an Azure Service Bus Topic under a Service Bus Namespace by using ServiceBusAdministrationClient

See also

For more information on how to use this operator, take a look at the guide: Create Azure Service Bus Topic

Parameters
  • topic_name (str) – Name of the topic.

  • default_message_time_to_live (datetime.timedelta | str | None) – ISO 8601 default message time span to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like “PT300S” is accepted.

  • max_size_in_megabytes (int | None) – The maximum size of the topic in megabytes, which is the size of memory allocated for the topic.

  • requires_duplicate_detection (bool | None) – A value indicating if this topic requires duplicate detection.

  • duplicate_detection_history_time_window (datetime.timedelta | str | None) – ISO 8601 time span structure that defines the duration of the duplicate detection history. The default value is 10 minutes. Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like “PT300S” is accepted.

  • enable_batched_operations (bool | None) – Value that indicates whether server-side batched operations are enabled.

  • size_in_bytes (int | None) – The size of the topic, in bytes.

  • filtering_messages_before_publishing (bool | None) – Filter messages before publishing.

  • authorization_rules (list[AuthorizationRule] | None) – List of Authorization rules for resource.

  • support_ordering (bool | None) – A value that indicates whether the topic supports ordering.

  • auto_delete_on_idle (datetime.timedelta | str | None) – ISO 8601 time span idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes. Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like “PT300S” is accepted.

  • enable_partitioning (bool | None) – A value that indicates whether the topic is to be partitioned across multiple message brokers.

  • enable_express (bool | None) – A value that indicates whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage.

  • user_metadata (str | None) – Metadata associated with the topic.

  • max_message_size_in_kilobytes (int | None) – The maximum size in kilobytes of message payload that can be accepted by the queue. This feature is only available when using a Premium namespace and Service Bus API version “2021-05” or higher. The minimum allowed value is 1024 while the maximum allowed value is 102400. Default value is 1024.

template_fields :Sequence[str] = ['topic_name'][source]
ui_color = #e4f0e8[source]
execute(context)[source]

Creates Topic in Service Bus namespace, by connecting to Service Bus Admin client

class airflow.providers.microsoft.azure.operators.asb.AzureServiceBusSubscriptionCreateOperator(*, topic_name, subscription_name, azure_service_bus_conn_id='azure_service_bus_default', lock_duration=None, requires_session=None, default_message_time_to_live=None, dead_lettering_on_message_expiration=True, dead_lettering_on_filter_evaluation_exceptions=None, max_delivery_count=10, enable_batched_operations=True, forward_to=None, user_metadata=None, forward_dead_lettered_messages_to=None, auto_delete_on_idle=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Create an Azure Service Bus Topic Subscription under a Service Bus Namespace by using ServiceBusAdministrationClient

See also

For more information on how to use this operator, take a look at the guide: Create Azure Service Bus Subscription

Parameters
  • topic_name (str) – The topic that will own the to-be-created subscription.

  • subscription_name (str) – Name of the subscription that need to be created

  • lock_duration (datetime.timedelta | str | None) – ISO 8601 time span duration of a peek-lock; that is, the amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute. Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like “PT300S” is accepted.

  • requires_session (bool | None) – A value that indicates whether the queue supports the concept of sessions.

  • default_message_time_to_live (datetime.timedelta | str | None) – ISO 8601 default message time span to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself. Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like “PT300S” is accepted.

  • dead_lettering_on_message_expiration (bool | None) – A value that indicates whether this subscription has dead letter support when a message expires.

  • dead_lettering_on_filter_evaluation_exceptions (bool | None) – A value that indicates whether this subscription has dead letter support when a message expires.

  • max_delivery_count (int | None) – The maximum delivery count. A message is automatically dead lettered after this number of deliveries. Default value is 10.

  • enable_batched_operations (bool | None) – Value that indicates whether server-side batched operations are enabled.

  • forward_to (str | None) – The name of the recipient entity to which all the messages sent to the subscription are forwarded to.

  • user_metadata (str | None) – Metadata associated with the subscription. Maximum number of characters is 1024.

  • forward_dead_lettered_messages_to (str | None) – The name of the recipient entity to which all the messages sent to the subscription are forwarded to.

  • auto_delete_on_idle (datetime.timedelta | str | None) – ISO 8601 time Span idle interval after which the subscription is automatically deleted. The minimum duration is 5 minutes. Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like “PT300S” is accepted.

  • azure_service_bus_conn_id (str) – Reference to the Azure Service Bus connection.

template_fields :Sequence[str] = ['topic_name', 'subscription_name'][source]
ui_color = #e4f0e8[source]
execute(context)[source]

Creates Subscription in Service Bus namespace, by connecting to Service Bus Admin client

class airflow.providers.microsoft.azure.operators.asb.AzureServiceBusUpdateSubscriptionOperator(*, topic_name, subscription_name, max_delivery_count=None, dead_lettering_on_message_expiration=None, enable_batched_operations=None, azure_service_bus_conn_id='azure_service_bus_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

Update an Azure ServiceBus Topic Subscription under a ServiceBus Namespace by using ServiceBusAdministrationClient

See also

For more information on how to use this operator, take a look at the guide: Update Azure Service Bus Subscription

Parameters
  • topic_name (str) – The topic that will own the to-be-created subscription.

  • subscription_name (str) – Name of the subscription that need to be created.

  • max_delivery_count (int | None) – The maximum delivery count. A message is automatically dead lettered after this number of deliveries. Default value is 10.

  • dead_lettering_on_message_expiration (bool | None) – A value that indicates whether this subscription has dead letter support when a message expires.

  • enable_batched_operations (bool | None) – Value that indicates whether server-side batched operations are enabled.

  • azure_service_bus_conn_id (str) – Reference to the Azure Service Bus connection.

template_fields :Sequence[str] = ['topic_name', 'subscription_name'][source]
ui_color = #e4f0e8[source]
execute(context)[source]

Updates Subscription properties, by connecting to Service Bus Admin client

class airflow.providers.microsoft.azure.operators.asb.ASBReceiveSubscriptionMessageOperator(*, topic_name, subscription_name, max_message_count=1, max_wait_time=5, azure_service_bus_conn_id='azure_service_bus_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

Receive a Batch messages from a Service Bus Subscription under specific Topic.

See also

For more information on how to use this operator, take a look at the guide: Receive Azure Service Bus Subscription Message

Parameters
  • subscription_name (str) – The subscription name that will own the rule in topic

  • topic_name (str) – The topic that will own the subscription rule.

  • max_message_count (int | None) – Maximum number of messages in the batch. Actual number returned will depend on prefetch_count and incoming stream rate. Setting to None will fully depend on the prefetch config. The default value is 1.

  • max_wait_time (float | None) – Maximum time to wait in seconds for the first message to arrive. If no messages arrive, and no timeout is specified, this call will not return until the connection is closed. If specified, an no messages arrive within the timeout period, an empty list will be returned.

  • azure_service_bus_conn_id (str) – Reference to the Azure Service Bus connection.

template_fields :Sequence[str] = ['topic_name', 'subscription_name'][source]
ui_color = #e4f0e8[source]
execute(context)[source]

Receive Message in specific queue in Service Bus namespace, by connecting to Service Bus client

class airflow.providers.microsoft.azure.operators.asb.AzureServiceBusSubscriptionDeleteOperator(*, topic_name, subscription_name, azure_service_bus_conn_id='azure_service_bus_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

Deletes the topic subscription in the Azure ServiceBus namespace

See also

For more information on how to use this operator, take a look at the guide: Delete Azure Service Bus Subscription

Parameters
  • topic_name (str) – The topic that will own the to-be-created subscription.

  • subscription_name (str) – Name of the subscription that need to be created

  • azure_service_bus_conn_id (str) – Reference to the Azure Service Bus connection.

template_fields :Sequence[str] = ['topic_name', 'subscription_name'][source]
ui_color = #e4f0e8[source]
execute(context)[source]

Delete topic subscription in Service Bus namespace, by connecting to Service Bus Admin client

class airflow.providers.microsoft.azure.operators.asb.AzureServiceBusTopicDeleteOperator(*, topic_name, azure_service_bus_conn_id='azure_service_bus_default', **kwargs)[source]

Bases: airflow.models.BaseOperator

Deletes the topic in the Azure Service Bus namespace

See also

For more information on how to use this operator, take a look at the guide: Delete Azure Service Bus Topic

Parameters
template_fields :Sequence[str] = ['topic_name'][source]
ui_color = #e4f0e8[source]
execute(context)[source]

Delete topic in Service Bus namespace, by connecting to Service Bus Admin client

Was this entry helpful?