Skip to content

Commit c1c84eb

Browse files
authored
[ServiceBus] Add large message support to SBAdministrationClient (Azure#20812)
* impl * update swagger * upload recordings * fix mypy pylint * review feedback * update classifier
1 parent 14d26ae commit c1c84eb

File tree

124 files changed

+8025
-5950
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+8025
-5950
lines changed

sdk/servicebus/azure-servicebus/CHANGELOG.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# Release History
22

3-
## 7.3.4 (Unreleased)
3+
## 7.4.0b1 (2021-10-05)
44

55
### Features Added
66

7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
7+
- 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.
8+
- Methods`create_queue`, `create_topic`, `update_queue`, `update_topic` on `ServiceBusAdministrationClient` now take a new keyword argument `max_message_size_in_kilobytes`.
9+
- `QueueProperties` and `TopicProperties` now have a new instance variable `max_message_size_in_kilobytes`.
1210

1311
## 7.3.3 (2021-09-08)
1412

sdk/servicebus/azure-servicebus/azure/servicebus/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Licensed under the MIT License.
44
# ------------------------------------
55

6-
VERSION = "7.3.4"
6+
VERSION = "7.4.0b1"

sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -293,58 +293,63 @@ async def create_queue(self, queue_name: str, **kwargs) -> QueueProperties:
293293
:param queue_name: Name of the queue.
294294
:type queue_name: str
295295
:keyword authorization_rules: Authorization rules for resource.
296-
:type authorization_rules: list[~azure.servicebus.management.AuthorizationRule]
296+
:paramtype authorization_rules: list[~azure.servicebus.management.AuthorizationRule]
297297
:keyword auto_delete_on_idle: ISO 8601 timeSpan idle interval after which the queue is
298298
automatically deleted. The minimum duration is 5 minutes.
299299
Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like "PT300S" is accepted.
300-
:type auto_delete_on_idle: Union[~datetime.timedelta, str]
300+
:paramtype auto_delete_on_idle: Union[~datetime.timedelta, str]
301301
:keyword dead_lettering_on_message_expiration: A value that indicates whether this queue has dead
302302
letter support when a message expires.
303-
:type dead_lettering_on_message_expiration: bool
303+
:paramtype dead_lettering_on_message_expiration: bool
304304
:keyword default_message_time_to_live: ISO 8601 default message timespan to live value. This is
305305
the duration after which the message expires, starting from when the message is sent to Service
306306
Bus. This is the default value used when TimeToLive is not set on a message itself.
307307
Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like "PT300S" is accepted.
308-
:type default_message_time_to_live: Union[~datetime.timedelta, str]
308+
:paramtype default_message_time_to_live: Union[~datetime.timedelta, str]
309309
:keyword duplicate_detection_history_time_window: ISO 8601 timeSpan structure that defines the
310310
duration of the duplicate detection history. The default value is 10 minutes.
311311
Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like "PT300S" is accepted.
312-
:type duplicate_detection_history_time_window: Union[~datetime.timedelta, str]
312+
:paramtype duplicate_detection_history_time_window: Union[~datetime.timedelta, str]
313313
:keyword enable_batched_operations: Value that indicates whether server-side batched operations
314314
are enabled.
315-
:type enable_batched_operations: bool
315+
:paramtype enable_batched_operations: bool
316316
:keyword enable_express: A value that indicates whether Express Entities are enabled. An express
317317
queue holds a message in memory temporarily before writing it to persistent storage.
318-
:type enable_express: bool
318+
:paramtype enable_express: bool
319319
:keyword enable_partitioning: A value that indicates whether the queue is to be partitioned
320320
across multiple message brokers.
321-
:type enable_partitioning: bool
321+
:paramtype enable_partitioning: bool
322322
:keyword lock_duration: ISO 8601 timespan duration of a peek-lock; that is, the amount of time
323323
that the message is locked for other receivers. The maximum value for LockDuration is 5
324324
minutes; the default value is 1 minute.
325325
Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like "PT300S" is accepted.
326-
:type lock_duration: Union[~datetime.timedelta, str]
326+
:paramtype lock_duration: Union[~datetime.timedelta, str]
327327
:keyword max_delivery_count: The maximum delivery count. A message is automatically deadlettered
328328
after this number of deliveries. Default value is 10.
329-
:type max_delivery_count: int
329+
:paramtype max_delivery_count: int
330330
:keyword max_size_in_megabytes: The maximum size of the queue in megabytes, which is the size of
331331
memory allocated for the queue.
332-
:type max_size_in_megabytes: int
332+
:paramtype max_size_in_megabytes: int
333333
:keyword requires_duplicate_detection: A value indicating if this queue requires duplicate
334334
detection.
335-
:type requires_duplicate_detection: bool
335+
:paramtype requires_duplicate_detection: bool
336336
:keyword requires_session: A value that indicates whether the queue supports the concept of
337337
sessions.
338-
:type requires_session: bool
338+
:paramtype requires_session: bool
339339
:keyword forward_to: The name of the recipient entity to which all the messages sent to the queue
340340
are forwarded to.
341-
:type forward_to: str
341+
:paramtype forward_to: str
342342
:keyword user_metadata: Custom metdata that user can associate with the description. Max length
343343
is 1024 chars.
344-
:type user_metadata: str
344+
:paramtype user_metadata: str
345345
:keyword forward_dead_lettered_messages_to: The name of the recipient entity to which all the
346346
dead-lettered messages of this subscription are forwarded to.
347-
:type forward_dead_lettered_messages_to: str
347+
:paramtype forward_dead_lettered_messages_to: str
348+
:keyword max_message_size_in_kilobytes: The maximum size in kilobytes of message payload that
349+
can be accepted by the queue. This feature is only available when using a Premium namespace
350+
and service version "2021-05" or higher.
351+
The minimum allowed value is 1024 while the maximum allowed value is 102400. Default value is 1024.
352+
:paramtype max_message_size_in_kilobytes: int
348353
349354
:rtype: ~azure.servicebus.management.QueueProperties
350355
"""
@@ -385,6 +390,7 @@ async def create_queue(self, queue_name: str, **kwargs) -> QueueProperties:
385390
forward_to=forward_to,
386391
forward_dead_lettered_messages_to=forward_dead_lettered_messages_to,
387392
user_metadata=kwargs.pop("user_metadata", None),
393+
max_message_size_in_kilobytes=kwargs.pop("max_message_size_in_kilobytes", None)
388394
)
389395
to_create = queue._to_internal_entity(self.fully_qualified_namespace)
390396
create_entity_body = CreateQueueBody(
@@ -553,41 +559,46 @@ async def create_topic(self, topic_name: str, **kwargs) -> TopicProperties:
553559
the duration after which the message expires, starting from when the message is sent to Service
554560
Bus. This is the default value used when TimeToLive is not set on a message itself.
555561
Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like "PT300S" is accepted.
556-
:type default_message_time_to_live: Union[~datetime.timedelta, str]
562+
:paramtype default_message_time_to_live: Union[~datetime.timedelta, str]
557563
:keyword max_size_in_megabytes: The maximum size of the topic in megabytes, which is the size of
558564
memory allocated for the topic.
559-
:type max_size_in_megabytes: long
565+
:paramtype max_size_in_megabytes: long
560566
:keyword requires_duplicate_detection: A value indicating if this topic requires duplicate
561567
detection.
562-
:type requires_duplicate_detection: bool
568+
:paramtype requires_duplicate_detection: bool
563569
:keyword duplicate_detection_history_time_window: ISO 8601 timeSpan structure that defines the
564570
duration of the duplicate detection history. The default value is 10 minutes.
565571
Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like "PT300S" is accepted.
566-
:type duplicate_detection_history_time_window: Union[~datetime.timedelta, str]
572+
:paramtype duplicate_detection_history_time_window: Union[~datetime.timedelta, str]
567573
:keyword enable_batched_operations: Value that indicates whether server-side batched operations
568574
are enabled.
569-
:type enable_batched_operations: bool
575+
:paramtype enable_batched_operations: bool
570576
:keyword size_in_bytes: The size of the topic, in bytes.
571-
:type size_in_bytes: int
577+
:paramtype size_in_bytes: int
572578
:keyword filtering_messages_before_publishing: Filter messages before publishing.
573-
:type filtering_messages_before_publishing: bool
579+
:paramtype filtering_messages_before_publishing: bool
574580
:keyword authorization_rules: Authorization rules for resource.
575-
:type authorization_rules:
581+
:paramtype authorization_rules:
576582
list[~azure.servicebus.management.AuthorizationRule]
577583
:keyword support_ordering: A value that indicates whether the topic supports ordering.
578-
:type support_ordering: bool
584+
:paramtype support_ordering: bool
579585
:keyword auto_delete_on_idle: ISO 8601 timeSpan idle interval after which the topic is
580586
automatically deleted. The minimum duration is 5 minutes.
581587
Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like "PT300S" is accepted.
582-
:type auto_delete_on_idle: Union[~datetime.timedelta, str]
588+
:paramtype auto_delete_on_idle: Union[~datetime.timedelta, str]
583589
:keyword enable_partitioning: A value that indicates whether the topic is to be partitioned
584590
across multiple message brokers.
585-
:type enable_partitioning: bool
591+
:paramtype enable_partitioning: bool
586592
:keyword enable_express: A value that indicates whether Express Entities are enabled. An express
587593
queue holds a message in memory temporarily before writing it to persistent storage.
588-
:type enable_express: bool
594+
:paramtype enable_express: bool
589595
:keyword user_metadata: Metadata associated with the topic.
590-
:type user_metadata: str
596+
:paramtype user_metadata: str
597+
:keyword max_message_size_in_kilobytes: The maximum size in kilobytes of message payload that
598+
can be accepted by the topic. This feature is only available when using a Premium namespace
599+
and service version "2021-05" or higher.
600+
The minimum allowed value is 1024 while the maximum allowed value is 102400. Default value is 1024.
601+
:paramtype max_message_size_in_kilobytes: int
591602
592603
:rtype: ~azure.servicebus.management.TopicProperties
593604
"""
@@ -614,6 +625,7 @@ async def create_topic(self, topic_name: str, **kwargs) -> TopicProperties:
614625
availability_status=None,
615626
enable_express=kwargs.pop("enable_express", None),
616627
user_metadata=kwargs.pop("user_metadata", None),
628+
max_message_size_in_kilobytes=kwargs.pop("max_message_size_in_kilobytes", None)
617629
)
618630
to_create = topic._to_internal_entity()
619631

@@ -796,40 +808,40 @@ async def create_subscription(
796808
that the message is locked for other receivers. The maximum value for LockDuration is 5
797809
minutes; the default value is 1 minute.
798810
Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like "PT300S" is accepted.
799-
:type lock_duration: Union[~datetime.timedelta, str]
811+
:paramtype lock_duration: Union[~datetime.timedelta, str]
800812
:keyword requires_session: A value that indicates whether the queue supports the concept of
801813
sessions.
802-
:type requires_session: bool
814+
:paramtype requires_session: bool
803815
:keyword default_message_time_to_live: ISO 8601 default message timespan to live value. This is
804816
the duration after which the message expires, starting from when the message is sent to Service
805817
Bus. This is the default value used when TimeToLive is not set on a message itself.
806818
Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like "PT300S" is accepted.
807-
:type default_message_time_to_live: Union[~datetime.timedelta, str]
819+
:paramtype default_message_time_to_live: Union[~datetime.timedelta, str]
808820
:keyword dead_lettering_on_message_expiration: A value that indicates whether this subscription
809821
has dead letter support when a message expires.
810-
:type dead_lettering_on_message_expiration: bool
822+
:paramtype dead_lettering_on_message_expiration: bool
811823
:keyword dead_lettering_on_filter_evaluation_exceptions: A value that indicates whether this
812824
subscription has dead letter support when a message expires.
813-
:type dead_lettering_on_filter_evaluation_exceptions: bool
825+
:paramtype dead_lettering_on_filter_evaluation_exceptions: bool
814826
:keyword max_delivery_count: The maximum delivery count. A message is automatically deadlettered
815827
after this number of deliveries. Default value is 10.
816-
:type max_delivery_count: int
828+
:paramtype max_delivery_count: int
817829
:keyword enable_batched_operations: Value that indicates whether server-side batched operations
818830
are enabled.
819-
:type enable_batched_operations: bool
831+
:paramtype enable_batched_operations: bool
820832
:keyword forward_to: The name of the recipient entity to which all the messages sent to the
821833
subscription are forwarded to.
822-
:type forward_to: str
834+
:paramtype forward_to: str
823835
:keyword user_metadata: Metadata associated with the subscription. Maximum number of characters
824836
is 1024.
825-
:type user_metadata: str
837+
:paramtype user_metadata: str
826838
:keyword forward_dead_lettered_messages_to: The name of the recipient entity to which all the
827839
messages sent to the subscription are forwarded to.
828-
:type forward_dead_lettered_messages_to: str
840+
:paramtype forward_dead_lettered_messages_to: str
829841
:keyword auto_delete_on_idle: ISO 8601 timeSpan idle interval after which the subscription is
830842
automatically deleted. The minimum duration is 5 minutes.
831843
Input value of either type ~datetime.timedelta or string in ISO 8601 duration format like "PT300S" is accepted.
832-
:type auto_delete_on_idle: Union[~datetime.timedelta, str]
844+
:paramtype auto_delete_on_idle: Union[~datetime.timedelta, str]
833845
:rtype: ~azure.servicebus.management.SubscriptionProperties
834846
"""
835847
# pylint:disable=protected-access
@@ -1047,10 +1059,10 @@ async def create_rule(
10471059
:param rule_name: Name of the rule.
10481060
:type rule_name: str
10491061
:keyword filter: The filter of the rule. The default value is ~azure.servicebus.management.TrueRuleFilter
1050-
:type filter: Union[~azure.servicebus.management.CorrelationRuleFilter,
1062+
:paramtype filter: Union[~azure.servicebus.management.CorrelationRuleFilter,
10511063
~azure.servicebus.management.SqlRuleFilter]
10521064
:keyword action: The action of the rule.
1053-
:type action: Optional[~azure.servicebus.management.SqlRuleAction]
1065+
:paramtype action: Optional[~azure.servicebus.management.SqlRuleAction]
10541066
10551067
:rtype: ~azure.servicebus.management.RuleProperties
10561068
"""

sdk/servicebus/azure-servicebus/azure/servicebus/management/_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Generated API parameters
77
API_VERSION_PARAM_NAME = "api-version"
8-
API_VERSION = "2017-04"
8+
API_VERSION = "2021-05"
99
ENTITY_TYPE_QUEUES = "queues"
1010
ENTITY_TYPE_TOPICS = "topics"
1111
LIST_OP_SKIP = "$skip"

sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "2017-04"
9+
VERSION = "2021-05"

sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/aio/operations_async/_entity_operations_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def get(
4343
self,
4444
entity_name: str,
4545
enrich: Optional[bool] = False,
46-
api_version: Optional[str] = "2017_04",
46+
api_version: Optional[str] = "2021_05",
4747
**kwargs
4848
) -> object:
4949
"""Get the details about the Queue or Topic with the given entityName.
@@ -106,7 +106,7 @@ async def put(
106106
self,
107107
entity_name: str,
108108
request_body: object,
109-
api_version: Optional[str] = "2017_04",
109+
api_version: Optional[str] = "2021_05",
110110
if_match: Optional[str] = None,
111111
**kwargs
112112
) -> object:
@@ -183,7 +183,7 @@ async def put(
183183
async def delete(
184184
self,
185185
entity_name: str,
186-
api_version: Optional[str] = "2017_04",
186+
api_version: Optional[str] = "2021_05",
187187
**kwargs
188188
) -> object:
189189
"""Delete the Queue or Topic with the given entityName.

sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/aio/operations_async/_namespace_operations_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:
4141

4242
async def get(
4343
self,
44-
api_version: Optional[str] = "2017_04",
44+
api_version: Optional[str] = "2021_05",
4545
**kwargs
4646
) -> "models.NamespacePropertiesEntry":
4747
"""Get the details about the Service Bus namespace.

sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/aio/operations_async/_rule_operations_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def get(
4545
subscription_name: str,
4646
rule_name: str,
4747
enrich: Optional[bool] = False,
48-
api_version: Optional[str] = "2017_04",
48+
api_version: Optional[str] = "2021_05",
4949
**kwargs
5050
) -> object:
5151
"""Get the details about the rule of a subscription of a topic.
@@ -116,7 +116,7 @@ async def put(
116116
subscription_name: str,
117117
rule_name: str,
118118
request_body: object,
119-
api_version: Optional[str] = "2017_04",
119+
api_version: Optional[str] = "2021_05",
120120
if_match: Optional[str] = None,
121121
**kwargs
122122
) -> object:
@@ -201,7 +201,7 @@ async def delete(
201201
topic_name: str,
202202
subscription_name: str,
203203
rule_name: str,
204-
api_version: Optional[str] = "2017_04",
204+
api_version: Optional[str] = "2021_05",
205205
**kwargs
206206
) -> object:
207207
"""Delete the rule with the given topicName, subscriptionName and ruleName.

sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/aio/operations_async/_service_bus_management_client_operations_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async def list_subscriptions(
2424
topic_name: str,
2525
skip: Optional[int] = 0,
2626
top: Optional[int] = 100,
27-
api_version: Optional[str] = "2017_04",
27+
api_version: Optional[str] = "2021_05",
2828
**kwargs
2929
) -> object:
3030
"""Get the details about the subscriptions of the given topic.
@@ -93,7 +93,7 @@ async def list_rules(
9393
subscription_name: str,
9494
skip: Optional[int] = 0,
9595
top: Optional[int] = 100,
96-
api_version: Optional[str] = "2017_04",
96+
api_version: Optional[str] = "2021_05",
9797
**kwargs
9898
) -> object:
9999
"""Get the details about the rules of the given topic subscription.
@@ -164,7 +164,7 @@ async def list_entities(
164164
entity_type: str,
165165
skip: Optional[int] = 0,
166166
top: Optional[int] = 100,
167-
api_version: Optional[str] = "2017_04",
167+
api_version: Optional[str] = "2021_05",
168168
**kwargs
169169
) -> object:
170170
"""Get the details about the entities of the given Service Bus namespace.

sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/aio/operations_async/_subscription_operations_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async def get(
4444
topic_name: str,
4545
subscription_name: str,
4646
enrich: Optional[bool] = False,
47-
api_version: Optional[str] = "2017_04",
47+
api_version: Optional[str] = "2021_05",
4848
**kwargs
4949
) -> object:
5050
"""Get the details about the subscription of a topic.
@@ -111,7 +111,7 @@ async def put(
111111
topic_name: str,
112112
subscription_name: str,
113113
request_body: object,
114-
api_version: Optional[str] = "2017_04",
114+
api_version: Optional[str] = "2021_05",
115115
if_match: Optional[str] = None,
116116
**kwargs
117117
) -> object:
@@ -192,7 +192,7 @@ async def delete(
192192
self,
193193
topic_name: str,
194194
subscription_name: str,
195-
api_version: Optional[str] = "2017_04",
195+
api_version: Optional[str] = "2021_05",
196196
**kwargs
197197
) -> object:
198198
"""Delete the subscription with the given topicName and subscriptionName.

0 commit comments

Comments
 (0)