|
| 1 | +--- |
| 2 | +title: Enable partitioning in Azure Service Bus Premium namespaces |
| 3 | +description: This article explains how to enable partitioning in Azure Service Bus Premium namespaces by using Azure portal, PowerShell, CLI, and programming languages (C#, Java, Python, and JavaScript) |
| 4 | +ms.topic: how-to |
| 5 | +ms.date: 10/12/2022 |
| 6 | +ms.custom: devx-track-azurepowershell, devx-track-azurecli, ignite-2022 |
| 7 | +ms.devlang: azurecli |
| 8 | +--- |
| 9 | + |
| 10 | +# Enable partitioning for an Azure Service Bus Premium namespace (Preview) |
| 11 | +Service Bus partitions enable queues and topics, or messaging entities, to be partitioned across multiple message brokers. Partitioning means that the overall throughput of a partitioned entity is no longer limited by the performance of a single message broker. In addition, a temporary outage of a message broker, for example during an upgrade, doesn't render a partitioned queue or topic unavailable. Partitioned queues and topics can contain all advanced Service Bus features, such as support for transactions and sessions. For more information, see [Partitioned queues and topics](service-bus-partitioning.md). This article shows you different ways to enable duplicate partitioning for a Service Bus Premium namespace. All entities in this namespace will be partitioned. |
| 12 | + |
| 13 | +> [!IMPORTANT] |
| 14 | +> This feature is currently in PREVIEW. See the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability. |
| 15 | +
|
| 16 | + |
| 17 | +> [!NOTE] |
| 18 | +> - This feature is currently available only in the East US and South Central US regions, with other regions being added during the public preview. |
| 19 | +> - Partitioning is available at entity creation for namespaces in the Premium SKU. Any previously existing partitioned entities in Premium namespaces continue to work as expected. |
| 20 | +> - It's not possible to change the partitioning option on any existing namespace. You can only set the option when you create a namespace. |
| 21 | +> - The assigned messaging units are always a multiplier of the amount of partitions in a namespace, and are equally distributed across the partitions. For example, in a namespace with 16MU and 4 partitions, each partition will be assigned 4MU. |
| 22 | +> |
| 23 | +> Some limitations may be encountered during public preview, which will be resolved before going into GA. |
| 24 | +> - It is currently not possible to use JMS on partitioned entities. |
| 25 | +> - Metrics are currently only available on an aggregated namespace level, not for individual partitions. |
| 26 | +> - This feature is rolling out during Ignite 2022, and will initially be available in East US and North Europe, with more regions following later. |
| 27 | +
|
| 28 | +## Use Azure portal |
| 29 | +When creating a **namespace** in the Azure portal, set the **Partitioning** to **Enabled** and choose the number of partitions, as shown in the following image. |
| 30 | +:::image type="content" source="./media/enable-partitions/create-namespace.png" alt-text="Screenshot of screen where partitioning is enabled at the time of the namespace creation."::: |
| 31 | + |
| 32 | +## Use Azure Resource Manager template |
| 33 | +To **create a namespace with partitioning enabled**, set `partitions` to a number larger than 1 in the namespace properties section. In the example below a partitioned namespace is created with 4 partitions, and 1 messaging unit assigned to each partition. For more information, see [Microsoft.ServiceBus namespaces template reference](/azure/templates/microsoft.servicebus/namespaces?tabs=json). |
| 34 | + |
| 35 | +```json |
| 36 | +{ |
| 37 | + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", |
| 38 | + "contentVersion": "1.0.0.0", |
| 39 | + "parameters": { |
| 40 | + "serviceBusNamespaceName": { |
| 41 | + "type": "string", |
| 42 | + "metadata": { |
| 43 | + "description": "Name of the Service Bus namespace" |
| 44 | + } |
| 45 | + }, |
| 46 | + "location": { |
| 47 | + "type": "string", |
| 48 | + "defaultValue": "[resourceGroup().location]", |
| 49 | + "metadata": { |
| 50 | + "description": "Location for all resources." |
| 51 | + } |
| 52 | + } |
| 53 | + }, |
| 54 | + "resources": [ |
| 55 | + { |
| 56 | + "type": "Microsoft.ServiceBus/namespaces", |
| 57 | + "apiVersion": "2022-10-01-preview", |
| 58 | + "name": "[parameters('serviceBusNamespaceName')]", |
| 59 | + "location": "[parameters('location')]", |
| 60 | + "sku": { |
| 61 | + "name": "Premium", |
| 62 | + "capacity": 4 |
| 63 | + }, |
| 64 | + "properties": { |
| 65 | + "premiumMessagingPartitions": 4 |
| 66 | + } |
| 67 | + } |
| 68 | + ] |
| 69 | +} |
| 70 | +``` |
| 71 | + |
| 72 | +## Next steps |
| 73 | +Try the samples in the language of your choice to explore Azure Service Bus features. |
| 74 | + |
| 75 | +- [Azure Service Bus client library samples for .NET (latest)](/samples/azure/azure-sdk-for-net/azuremessagingservicebus-samples/) |
| 76 | +- [Azure Service Bus client library samples for Java (latest)](/samples/azure/azure-sdk-for-java/servicebus-samples/) |
| 77 | +- [Azure Service Bus client library samples for Python](/samples/azure/azure-sdk-for-python/servicebus-samples/) |
| 78 | +- [Azure Service Bus client library samples for JavaScript](/samples/azure/azure-sdk-for-js/service-bus-javascript/) |
| 79 | +- [Azure Service Bus client library samples for TypeScript](/samples/azure/azure-sdk-for-js/service-bus-typescript/) |
| 80 | + |
0 commit comments