Skip to content

Commit

Permalink
[ServiceBus] Add large message support to SBAdministrationClient (Azu…
Browse files Browse the repository at this point in the history
…re#20812)

* impl

* update swagger

* upload recordings

* fix mypy pylint

* review feedback

* update classifier
  • Loading branch information
yunhaoling authored Sep 29, 2021
1 parent 14d26ae commit c1c84eb
Show file tree
Hide file tree
Showing 124 changed files with 8,025 additions and 5,950 deletions.
10 changes: 4 additions & 6 deletions sdk/servicebus/azure-servicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Release History

## 7.3.4 (Unreleased)
## 7.4.0b1 (2021-10-05)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
- Added support to create and update queues and topics of large message size to `ServiceBusAdministrationClient`. This feature is only available for Service Bus of Premium Tier.
- Methods`create_queue`, `create_topic`, `update_queue`, `update_topic` on `ServiceBusAdministrationClient` now take a new keyword argument `max_message_size_in_kilobytes`.
- `QueueProperties` and `TopicProperties` now have a new instance variable `max_message_size_in_kilobytes`.

## 7.3.3 (2021-09-08)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Licensed under the MIT License.
# ------------------------------------

VERSION = "7.3.4"
VERSION = "7.4.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -293,58 +293,63 @@ async def create_queue(self, queue_name: str, **kwargs) -> QueueProperties:
:param queue_name: Name of the queue.
:type queue_name: str
:keyword authorization_rules: Authorization rules for resource.
:type authorization_rules: list[~azure.servicebus.management.AuthorizationRule]
:paramtype authorization_rules: list[~azure.servicebus.management.AuthorizationRule]
:keyword auto_delete_on_idle: ISO 8601 timeSpan idle interval after which the queue 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.
:type auto_delete_on_idle: Union[~datetime.timedelta, str]
:paramtype auto_delete_on_idle: Union[~datetime.timedelta, str]
:keyword dead_lettering_on_message_expiration: A value that indicates whether this queue has dead
letter support when a message expires.
:type dead_lettering_on_message_expiration: bool
:paramtype dead_lettering_on_message_expiration: bool
:keyword default_message_time_to_live: ISO 8601 default message timespan 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.
:type default_message_time_to_live: Union[~datetime.timedelta, str]
:paramtype default_message_time_to_live: Union[~datetime.timedelta, str]
:keyword duplicate_detection_history_time_window: ISO 8601 timeSpan 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.
:type duplicate_detection_history_time_window: Union[~datetime.timedelta, str]
:paramtype duplicate_detection_history_time_window: Union[~datetime.timedelta, str]
:keyword enable_batched_operations: Value that indicates whether server-side batched operations
are enabled.
:type enable_batched_operations: bool
:paramtype enable_batched_operations: bool
:keyword enable_express: A value that indicates whether Express Entities are enabled. An express
queue holds a message in memory temporarily before writing it to persistent storage.
:type enable_express: bool
:paramtype enable_express: bool
:keyword enable_partitioning: A value that indicates whether the queue is to be partitioned
across multiple message brokers.
:type enable_partitioning: bool
:paramtype enable_partitioning: bool
:keyword lock_duration: ISO 8601 timespan 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.
:type lock_duration: Union[~datetime.timedelta, str]
:paramtype lock_duration: Union[~datetime.timedelta, str]
:keyword max_delivery_count: The maximum delivery count. A message is automatically deadlettered
after this number of deliveries. Default value is 10.
:type max_delivery_count: int
:paramtype max_delivery_count: int
:keyword max_size_in_megabytes: The maximum size of the queue in megabytes, which is the size of
memory allocated for the queue.
:type max_size_in_megabytes: int
:paramtype max_size_in_megabytes: int
:keyword requires_duplicate_detection: A value indicating if this queue requires duplicate
detection.
:type requires_duplicate_detection: bool
:paramtype requires_duplicate_detection: bool
:keyword requires_session: A value that indicates whether the queue supports the concept of
sessions.
:type requires_session: bool
:paramtype requires_session: bool
:keyword forward_to: The name of the recipient entity to which all the messages sent to the queue
are forwarded to.
:type forward_to: str
:paramtype forward_to: str
:keyword user_metadata: Custom metdata that user can associate with the description. Max length
is 1024 chars.
:type user_metadata: str
:paramtype user_metadata: str
:keyword forward_dead_lettered_messages_to: The name of the recipient entity to which all the
dead-lettered messages of this subscription are forwarded to.
:type forward_dead_lettered_messages_to: str
:paramtype forward_dead_lettered_messages_to: str
:keyword max_message_size_in_kilobytes: 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 version "2021-05" or higher.
The minimum allowed value is 1024 while the maximum allowed value is 102400. Default value is 1024.
:paramtype max_message_size_in_kilobytes: int
:rtype: ~azure.servicebus.management.QueueProperties
"""
Expand Down Expand Up @@ -385,6 +390,7 @@ async def create_queue(self, queue_name: str, **kwargs) -> QueueProperties:
forward_to=forward_to,
forward_dead_lettered_messages_to=forward_dead_lettered_messages_to,
user_metadata=kwargs.pop("user_metadata", None),
max_message_size_in_kilobytes=kwargs.pop("max_message_size_in_kilobytes", None)
)
to_create = queue._to_internal_entity(self.fully_qualified_namespace)
create_entity_body = CreateQueueBody(
Expand Down Expand Up @@ -553,41 +559,46 @@ async def create_topic(self, topic_name: str, **kwargs) -> TopicProperties:
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.
:type default_message_time_to_live: Union[~datetime.timedelta, str]
:paramtype default_message_time_to_live: Union[~datetime.timedelta, str]
:keyword max_size_in_megabytes: The maximum size of the topic in megabytes, which is the size of
memory allocated for the topic.
:type max_size_in_megabytes: long
:paramtype max_size_in_megabytes: long
:keyword requires_duplicate_detection: A value indicating if this topic requires duplicate
detection.
:type requires_duplicate_detection: bool
:paramtype requires_duplicate_detection: bool
:keyword duplicate_detection_history_time_window: ISO 8601 timeSpan 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.
:type duplicate_detection_history_time_window: Union[~datetime.timedelta, str]
:paramtype duplicate_detection_history_time_window: Union[~datetime.timedelta, str]
:keyword enable_batched_operations: Value that indicates whether server-side batched operations
are enabled.
:type enable_batched_operations: bool
:paramtype enable_batched_operations: bool
:keyword size_in_bytes: The size of the topic, in bytes.
:type size_in_bytes: int
:paramtype size_in_bytes: int
:keyword filtering_messages_before_publishing: Filter messages before publishing.
:type filtering_messages_before_publishing: bool
:paramtype filtering_messages_before_publishing: bool
:keyword authorization_rules: Authorization rules for resource.
:type authorization_rules:
:paramtype authorization_rules:
list[~azure.servicebus.management.AuthorizationRule]
:keyword support_ordering: A value that indicates whether the topic supports ordering.
:type support_ordering: bool
:paramtype support_ordering: bool
:keyword auto_delete_on_idle: ISO 8601 timeSpan 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.
:type auto_delete_on_idle: Union[~datetime.timedelta, str]
:paramtype auto_delete_on_idle: Union[~datetime.timedelta, str]
:keyword enable_partitioning: A value that indicates whether the topic is to be partitioned
across multiple message brokers.
:type enable_partitioning: bool
:paramtype enable_partitioning: bool
:keyword enable_express: A value that indicates whether Express Entities are enabled. An express
queue holds a message in memory temporarily before writing it to persistent storage.
:type enable_express: bool
:paramtype enable_express: bool
:keyword user_metadata: Metadata associated with the topic.
:type user_metadata: str
:paramtype user_metadata: str
:keyword max_message_size_in_kilobytes: The maximum size in kilobytes of message payload that
can be accepted by the topic. This feature is only available when using a Premium namespace
and service version "2021-05" or higher.
The minimum allowed value is 1024 while the maximum allowed value is 102400. Default value is 1024.
:paramtype max_message_size_in_kilobytes: int
:rtype: ~azure.servicebus.management.TopicProperties
"""
Expand All @@ -614,6 +625,7 @@ async def create_topic(self, topic_name: str, **kwargs) -> TopicProperties:
availability_status=None,
enable_express=kwargs.pop("enable_express", None),
user_metadata=kwargs.pop("user_metadata", None),
max_message_size_in_kilobytes=kwargs.pop("max_message_size_in_kilobytes", None)
)
to_create = topic._to_internal_entity()

Expand Down Expand Up @@ -796,40 +808,40 @@ async def create_subscription(
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.
:type lock_duration: Union[~datetime.timedelta, str]
:paramtype lock_duration: Union[~datetime.timedelta, str]
:keyword requires_session: A value that indicates whether the queue supports the concept of
sessions.
:type requires_session: bool
:paramtype requires_session: bool
:keyword default_message_time_to_live: ISO 8601 default message timespan 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.
:type default_message_time_to_live: Union[~datetime.timedelta, str]
:paramtype default_message_time_to_live: Union[~datetime.timedelta, str]
:keyword dead_lettering_on_message_expiration: A value that indicates whether this subscription
has dead letter support when a message expires.
:type dead_lettering_on_message_expiration: bool
:paramtype dead_lettering_on_message_expiration: bool
:keyword dead_lettering_on_filter_evaluation_exceptions: A value that indicates whether this
subscription has dead letter support when a message expires.
:type dead_lettering_on_filter_evaluation_exceptions: bool
:paramtype dead_lettering_on_filter_evaluation_exceptions: bool
:keyword max_delivery_count: The maximum delivery count. A message is automatically deadlettered
after this number of deliveries. Default value is 10.
:type max_delivery_count: int
:paramtype max_delivery_count: int
:keyword enable_batched_operations: Value that indicates whether server-side batched operations
are enabled.
:type enable_batched_operations: bool
:paramtype enable_batched_operations: bool
:keyword forward_to: The name of the recipient entity to which all the messages sent to the
subscription are forwarded to.
:type forward_to: str
:paramtype forward_to: str
:keyword user_metadata: Metadata associated with the subscription. Maximum number of characters
is 1024.
:type user_metadata: str
:paramtype user_metadata: str
:keyword forward_dead_lettered_messages_to: The name of the recipient entity to which all the
messages sent to the subscription are forwarded to.
:type forward_dead_lettered_messages_to: str
:paramtype forward_dead_lettered_messages_to: str
:keyword auto_delete_on_idle: ISO 8601 timeSpan 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.
:type auto_delete_on_idle: Union[~datetime.timedelta, str]
:paramtype auto_delete_on_idle: Union[~datetime.timedelta, str]
:rtype: ~azure.servicebus.management.SubscriptionProperties
"""
# pylint:disable=protected-access
Expand Down Expand Up @@ -1047,10 +1059,10 @@ async def create_rule(
:param rule_name: Name of the rule.
:type rule_name: str
:keyword filter: The filter of the rule. The default value is ~azure.servicebus.management.TrueRuleFilter
:type filter: Union[~azure.servicebus.management.CorrelationRuleFilter,
:paramtype filter: Union[~azure.servicebus.management.CorrelationRuleFilter,
~azure.servicebus.management.SqlRuleFilter]
:keyword action: The action of the rule.
:type action: Optional[~azure.servicebus.management.SqlRuleAction]
:paramtype action: Optional[~azure.servicebus.management.SqlRuleAction]
:rtype: ~azure.servicebus.management.RuleProperties
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# Generated API parameters
API_VERSION_PARAM_NAME = "api-version"
API_VERSION = "2017-04"
API_VERSION = "2021-05"
ENTITY_TYPE_QUEUES = "queues"
ENTITY_TYPE_TOPICS = "topics"
LIST_OP_SKIP = "$skip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "2017-04"
VERSION = "2021-05"
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def get(
self,
entity_name: str,
enrich: Optional[bool] = False,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
**kwargs
) -> object:
"""Get the details about the Queue or Topic with the given entityName.
Expand Down Expand Up @@ -106,7 +106,7 @@ async def put(
self,
entity_name: str,
request_body: object,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
if_match: Optional[str] = None,
**kwargs
) -> object:
Expand Down Expand Up @@ -183,7 +183,7 @@ async def put(
async def delete(
self,
entity_name: str,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
**kwargs
) -> object:
"""Delete the Queue or Topic with the given entityName.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:

async def get(
self,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
**kwargs
) -> "models.NamespacePropertiesEntry":
"""Get the details about the Service Bus namespace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def get(
subscription_name: str,
rule_name: str,
enrich: Optional[bool] = False,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
**kwargs
) -> object:
"""Get the details about the rule of a subscription of a topic.
Expand Down Expand Up @@ -116,7 +116,7 @@ async def put(
subscription_name: str,
rule_name: str,
request_body: object,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
if_match: Optional[str] = None,
**kwargs
) -> object:
Expand Down Expand Up @@ -201,7 +201,7 @@ async def delete(
topic_name: str,
subscription_name: str,
rule_name: str,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
**kwargs
) -> object:
"""Delete the rule with the given topicName, subscriptionName and ruleName.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def list_subscriptions(
topic_name: str,
skip: Optional[int] = 0,
top: Optional[int] = 100,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
**kwargs
) -> object:
"""Get the details about the subscriptions of the given topic.
Expand Down Expand Up @@ -93,7 +93,7 @@ async def list_rules(
subscription_name: str,
skip: Optional[int] = 0,
top: Optional[int] = 100,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
**kwargs
) -> object:
"""Get the details about the rules of the given topic subscription.
Expand Down Expand Up @@ -164,7 +164,7 @@ async def list_entities(
entity_type: str,
skip: Optional[int] = 0,
top: Optional[int] = 100,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
**kwargs
) -> object:
"""Get the details about the entities of the given Service Bus namespace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async def get(
topic_name: str,
subscription_name: str,
enrich: Optional[bool] = False,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
**kwargs
) -> object:
"""Get the details about the subscription of a topic.
Expand Down Expand Up @@ -111,7 +111,7 @@ async def put(
topic_name: str,
subscription_name: str,
request_body: object,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
if_match: Optional[str] = None,
**kwargs
) -> object:
Expand Down Expand Up @@ -192,7 +192,7 @@ async def delete(
self,
topic_name: str,
subscription_name: str,
api_version: Optional[str] = "2017_04",
api_version: Optional[str] = "2021_05",
**kwargs
) -> object:
"""Delete the subscription with the given topicName and subscriptionName.
Expand Down
Loading

0 comments on commit c1c84eb

Please sign in to comment.