airflow.providers.microsoft.azure.hooks.asb
¶
Module Contents¶
Classes¶
BaseAzureServiceBusHook class to create session and create connection using connection string |
|
Interacts with ServiceBusAdministrationClient client |
|
Interacts with ServiceBusClient and acts as a high level interface |
- class airflow.providers.microsoft.azure.hooks.asb.BaseAzureServiceBusHook(azure_service_bus_conn_id=default_conn_name)[source]¶
Bases:
airflow.hooks.base.BaseHook
BaseAzureServiceBusHook class to create session and create connection using connection string
- Parameters
azure_service_bus_conn_id (str) – Reference to the Azure Service Bus connection.
- class airflow.providers.microsoft.azure.hooks.asb.AdminClientHook(azure_service_bus_conn_id=default_conn_name)[source]¶
Bases:
BaseAzureServiceBusHook
Interacts with ServiceBusAdministrationClient client to create, update, list, and delete resources of a Service Bus namespace. This hook uses the same Azure Service Bus client connection inherited from the base class
- get_conn(self)[source]¶
Create and returns ServiceBusAdministrationClient by using the connection string in connection details
- create_queue(self, queue_name, max_delivery_count=10, dead_lettering_on_message_expiration=True, enable_batched_operations=True)[source]¶
Create Queue by connecting to service Bus Admin client return the QueueProperties
- Parameters
queue_name (str) – The name of the queue or a QueueProperties with name.
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.
- class airflow.providers.microsoft.azure.hooks.asb.MessageHook(azure_service_bus_conn_id=default_conn_name)[source]¶
Bases:
BaseAzureServiceBusHook
Interacts with ServiceBusClient and acts as a high level interface for getting ServiceBusSender and ServiceBusReceiver.
- get_conn(self)[source]¶
Create and returns ServiceBusClient by using the connection string in connection details
- send_message(self, queue_name, messages, batch_message_flag=False)[source]¶
By using ServiceBusClient Send message(s) to a Service Bus Queue. By using batch_message_flag it enables and send message as batch message
- Parameters