Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions sdk/servicebus/azure-servicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
# Release History

## 7.3.5 (Unreleased)
## 7.4.0 (Unreleased)

### Features Added

### Breaking 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`.
- The constructor of`ServiceBusAdministrationClient` as well as `ServiceBusAdministrationClient.from_connection_string` now take keyword argument `api_version` to configure the Service Bus API version. Supported service versions are "2021-05" and "2017-04".
- Added new enum class `azure.servicebus.management.ApiVersion` to represent the supported Service Bus API versions.

### Bugs Fixed

- Fixed bug that `ServiceBusReceiver` can not connect to sessionful entity with session id being empty string.
- Fixed bug that `ServiceBusMessage.partition_key` can not parse empty string properly.

### Other Changes
## 7.4.0b1 (2021-10-06)

### Features Added

- 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.4 (2021-10-06)

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.5"
VERSION = "7.4.0"

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import urllib.parse as urlparse

from ...management import _constants as constants
from ...management._api_version import DEFAULT_VERSION
from ...management._handle_response_error import _handle_response_error

# This module defines functions get_next_template and extract_data_template.
Expand Down Expand Up @@ -126,7 +127,7 @@ async def get_next_template(
XML ElementTree to call a partial function created from `extrat_data_template`.

"""
api_version = constants.API_VERSION
api_version = kwargs.pop("api_version", DEFAULT_VERSION)
if args[0]: # It's next link. It's None for the first page.
queries = urlparse.parse_qs(urlparse.urlparse(args[0]).query)
start_index = int(queries[constants.LIST_OP_SKIP][0])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
MessagingSku,
NamespaceType,
)
from ._api_version import ApiVersion

from ._models import (
QueueRuntimeProperties,
Expand Down Expand Up @@ -52,4 +53,5 @@
"NamespaceProperties",
"MessagingSku",
"NamespaceType",
"ApiVersion"
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from enum import Enum


class ApiVersion(str, Enum):
V2021_05 = "2021-05"
V2017_04 = "2017-04"


DEFAULT_VERSION = ApiVersion.V2021_05
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

# Generated API parameters
API_VERSION_PARAM_NAME = "api-version"
API_VERSION = "2017-04"
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AuthorizationRule(msrest.serialization.Model):
:param claim_value: The claim value.
:type claim_value: str
:param rights: Access rights of the entity. Values are 'Send', 'Listen', or 'Manage'.
:type rights: list[str]
:type rights: list[str or ~azure.servicebus.management._generated.models.AccessRights]
:param created_time: The date and time when the authorization rule was created.
:type created_time: ~datetime.datetime
:param modified_time: The date and time when the authorization rule was modified.
Expand Down Expand Up @@ -757,6 +757,9 @@ class QueueDescription(msrest.serialization.Model):
:param 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
:param max_message_size_in_kilobytes: The maximum size in kilobytes of message payload that can
be accepted by the queue.
:type max_message_size_in_kilobytes: int
"""

_attribute_map = {
Expand Down Expand Up @@ -786,6 +789,7 @@ class QueueDescription(msrest.serialization.Model):
'entity_availability_status': {'key': 'entityAvailabilityStatus', 'type': 'str', 'xml': {'name': 'EntityAvailabilityStatus', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
'enable_express': {'key': 'enableExpress', 'type': 'bool', 'xml': {'name': 'EnableExpress', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
'forward_dead_lettered_messages_to': {'key': 'forwardDeadLetteredMessagesTo', 'type': 'str', 'xml': {'name': 'ForwardDeadLetteredMessagesTo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
'max_message_size_in_kilobytes': {'key': 'maxMessageSizeInKilobytes', 'type': 'int', 'xml': {'name': 'MaxMessageSizeInKilobytes', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'QueueDescription', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
Expand Down Expand Up @@ -822,6 +826,7 @@ def __init__(
self.entity_availability_status = kwargs.get('entity_availability_status', None)
self.enable_express = kwargs.get('enable_express', None)
self.forward_dead_lettered_messages_to = kwargs.get('forward_dead_lettered_messages_to', None)
self.max_message_size_in_kilobytes = kwargs.get('max_message_size_in_kilobytes', None)


class QueueDescriptionEntry(msrest.serialization.Model):
Expand Down Expand Up @@ -1468,6 +1473,9 @@ class TopicDescription(msrest.serialization.Model):
:type enable_express: bool
:param user_metadata: Metadata associated with the topic.
:type user_metadata: str
:param max_message_size_in_kilobytes: The maximum size in kilobytes of message payload that can
be accepted by the topic.
:type max_message_size_in_kilobytes: int
"""

_attribute_map = {
Expand All @@ -1493,6 +1501,7 @@ class TopicDescription(msrest.serialization.Model):
'enable_subscription_partitioning': {'key': 'enableSubscriptionPartitioning', 'type': 'bool', 'xml': {'name': 'EnableSubscriptionPartitioning', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
'enable_express': {'key': 'enableExpress', 'type': 'bool', 'xml': {'name': 'EnableExpress', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
'user_metadata': {'key': 'userMetadata', 'type': 'str', 'xml': {'name': 'UserMetadata', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
'max_message_size_in_kilobytes': {'key': 'maxMessageSizeInKilobytes', 'type': 'int', 'xml': {'name': 'MaxMessageSizeInKilobytes', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'TopicDescription', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
Expand Down Expand Up @@ -1525,6 +1534,7 @@ def __init__(
self.enable_subscription_partitioning = kwargs.get('enable_subscription_partitioning', None)
self.enable_express = kwargs.get('enable_express', None)
self.user_metadata = kwargs.get('user_metadata', None)
self.max_message_size_in_kilobytes = kwargs.get('max_message_size_in_kilobytes', None)


class TopicDescriptionEntry(msrest.serialization.Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AuthorizationRule(msrest.serialization.Model):
:param claim_value: The claim value.
:type claim_value: str
:param rights: Access rights of the entity. Values are 'Send', 'Listen', or 'Manage'.
:type rights: list[str]
:type rights: list[str or ~azure.servicebus.management._generated.models.AccessRights]
:param created_time: The date and time when the authorization rule was created.
:type created_time: ~datetime.datetime
:param modified_time: The date and time when the authorization rule was modified.
Expand Down Expand Up @@ -59,7 +59,7 @@ def __init__(
type: Optional[str] = None,
claim_type: Optional[str] = None,
claim_value: Optional[str] = None,
rights: Optional[List[str]] = None,
rights: Optional[List[Union[str, "AccessRights"]]] = None,
created_time: Optional[datetime.datetime] = None,
modified_time: Optional[datetime.datetime] = None,
key_name: Optional[str] = None,
Expand Down Expand Up @@ -839,6 +839,9 @@ class QueueDescription(msrest.serialization.Model):
:param 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
:param max_message_size_in_kilobytes: The maximum size in kilobytes of message payload that can
be accepted by the queue.
:type max_message_size_in_kilobytes: int
"""

_attribute_map = {
Expand Down Expand Up @@ -868,6 +871,7 @@ class QueueDescription(msrest.serialization.Model):
'entity_availability_status': {'key': 'entityAvailabilityStatus', 'type': 'str', 'xml': {'name': 'EntityAvailabilityStatus', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
'enable_express': {'key': 'enableExpress', 'type': 'bool', 'xml': {'name': 'EnableExpress', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
'forward_dead_lettered_messages_to': {'key': 'forwardDeadLetteredMessagesTo', 'type': 'str', 'xml': {'name': 'ForwardDeadLetteredMessagesTo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
'max_message_size_in_kilobytes': {'key': 'maxMessageSizeInKilobytes', 'type': 'int', 'xml': {'name': 'MaxMessageSizeInKilobytes', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'QueueDescription', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
Expand Down Expand Up @@ -902,6 +906,7 @@ def __init__(
entity_availability_status: Optional[Union[str, "EntityAvailabilityStatus"]] = None,
enable_express: Optional[bool] = None,
forward_dead_lettered_messages_to: Optional[str] = None,
max_message_size_in_kilobytes: Optional[int] = None,
**kwargs
):
super(QueueDescription, self).__init__(**kwargs)
Expand Down Expand Up @@ -931,6 +936,7 @@ def __init__(
self.entity_availability_status = entity_availability_status
self.enable_express = enable_express
self.forward_dead_lettered_messages_to = forward_dead_lettered_messages_to
self.max_message_size_in_kilobytes = max_message_size_in_kilobytes


class QueueDescriptionEntry(msrest.serialization.Model):
Expand Down Expand Up @@ -1664,6 +1670,9 @@ class TopicDescription(msrest.serialization.Model):
:type enable_express: bool
:param user_metadata: Metadata associated with the topic.
:type user_metadata: str
:param max_message_size_in_kilobytes: The maximum size in kilobytes of message payload that can
be accepted by the topic.
:type max_message_size_in_kilobytes: int
"""

_attribute_map = {
Expand All @@ -1689,6 +1698,7 @@ class TopicDescription(msrest.serialization.Model):
'enable_subscription_partitioning': {'key': 'enableSubscriptionPartitioning', 'type': 'bool', 'xml': {'name': 'EnableSubscriptionPartitioning', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
'enable_express': {'key': 'enableExpress', 'type': 'bool', 'xml': {'name': 'EnableExpress', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
'user_metadata': {'key': 'userMetadata', 'type': 'str', 'xml': {'name': 'UserMetadata', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
'max_message_size_in_kilobytes': {'key': 'maxMessageSizeInKilobytes', 'type': 'int', 'xml': {'name': 'MaxMessageSizeInKilobytes', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'TopicDescription', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
Expand Down Expand Up @@ -1719,6 +1729,7 @@ def __init__(
enable_subscription_partitioning: Optional[bool] = None,
enable_express: Optional[bool] = None,
user_metadata: Optional[str] = None,
max_message_size_in_kilobytes: Optional[int] = None,
**kwargs
):
super(TopicDescription, self).__init__(**kwargs)
Expand All @@ -1744,6 +1755,7 @@ def __init__(
self.enable_subscription_partitioning = enable_subscription_partitioning
self.enable_express = enable_express
self.user_metadata = user_metadata
self.max_message_size_in_kilobytes = max_message_size_in_kilobytes


class TopicDescriptionEntry(msrest.serialization.Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get(
self,
entity_name, # type: str
enrich=False, # type: Optional[bool]
api_version="2017_04", # type: Optional[str]
api_version="2021_05", # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> object
Expand Down Expand Up @@ -111,7 +111,7 @@ def put(
self,
entity_name, # type: str
request_body, # type: object
api_version="2017_04", # type: Optional[str]
api_version="2021_05", # type: Optional[str]
if_match=None, # type: Optional[str]
**kwargs # type: Any
):
Expand Down Expand Up @@ -189,7 +189,7 @@ def put(
def delete(
self,
entity_name, # type: str
api_version="2017_04", # type: Optional[str]
api_version="2021_05", # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer):

def get(
self,
api_version="2017_04", # type: Optional[str]
api_version="2021_05", # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> "models.NamespacePropertiesEntry"
Expand Down
Loading