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
2 changes: 2 additions & 0 deletions src/ResourceManager/ServiceBus/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
- Additional information about change #1
-->
## Current Release
* Added EnableBatchedOperations property to Queue
* Added DeadLetteringOnFilterEvaluationExceptions property to Subscriptions

## Version 0.6.1
* Added functionality fix for Remove-AzureRmServiceBusRule and Get-AzureRmServiceBusKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.1.0.2\lib\portable-net45+wp8+wpa81+win\Microsoft.Azure.Management.Authorization.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ServiceBus.1.0.3\lib\net452\Microsoft.Azure.Management.ServiceBus.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ServiceBus.1.1.0\lib\net452\Microsoft.Azure.Management.ServiceBus.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function ServiceBusQueueTests
$resultGetQueue.DeadLetteringOnMessageExpiration = $True
$resultGetQueue.MaxDeliveryCount = 5
$resultGetQueue.MaxSizeInMegabytes = 1024
$resultGetQueue.EnableBatchedOperations = $True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@v-Ajnava are there any tests that cover the new switch parameters being used rather than the property being set on the object?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its used to set the batchoperations service side. nothing no client side besides setting it.


$resltSetQueue = Set-AzureRmServiceBusQueue -ResourceGroupName $resourceGroupName -Namespace $namespaceName -Name $resultGetQueue.Name -InputObject $resultGetQueue
Assert-AreEqual $resltSetQueue.Name $resultGetQueue.Name "In GetQueue response, QueueName not found"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ function ServiceBusSubscriptionTests
Assert-True {$ResulListTopic.Count -gt 0} "no Topics were found in ListTopic"

#Create Topic
Write-Debug " Create new SB Topic-Subscription"
Write-Debug " SB Topic-Subscription Name : $subName"
$resltNewSub = New-AzureRmServiceBusSubscription -ResourceGroupName $resourceGroupName -Namespace $namespaceName -Topic $resultGetTopic.Name -Name $subName
Write-Debug "Create new SB Topic-Subscription"
Write-Debug "SB Topic-Subscription Name : $subName"
$resltNewSub = New-AzureRmServiceBusSubscription -ResourceGroupName $resourceGroupName -Namespace $namespaceName -Topic $nameTopic -Name $subName -DeadLetteringOnFilterEvaluationExceptions
Assert-AreEqual $resltNewSub.Name $subName "Subscription created earlier is not found"

# Get Created Subscritpiton Name
$resultGetSub = Get-AzureRmServiceBusSubscription -ResourceGroupName $resourceGroupName -Namespace $namespaceName -Topic $resultGetTopic.Name -Name $subName
$resultGetSub = Get-AzureRmServiceBusSubscription -ResourceGroupName $resourceGroupName -Namespace $namespaceName -Topic $nameTopic -Name $subName
Assert-AreEqual $resultGetSub.Name $subName "Get-Subscription: Subscription created earlier is not found"

Assert-True {$resultGetSub.DeadLetteringOnFilterEvaluationExceptions} "New-subscription: DeadLetteringOnFilterEvaluationExceptions not updated "

# Update the subscription.
$resultSetSub = Set-AzureRmServiceBusSubscription -ResourceGroupName $resourceGroupName -Namespace $namespaceName -Topic $resultGetTopic.Name -InputObject $resultGetSub

$resultSetSub = Set-AzureRmServiceBusSubscription -ResourceGroupName $resourceGroupName -Namespace $namespaceName -Topic $resultGetTopic.Name -InputObject $resultGetSub
Assert-AreEqual $resultSetSub.Name $resultGetSub.Name "Subscription Updated earlier is not found"

# Delete the created/Updated Subscription
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Authorization" version="1.0.2" targetFramework="net452" />
<package id="Microsoft.Azure.Management.Resources" version="2.20.0-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.ServiceBus" version="1.0.3" targetFramework="net452" />
<package id="Microsoft.Azure.Management.ServiceBus" version="1.1.0" targetFramework="net452" />
<package id="Microsoft.Azure.Test.Framework" version="1.0.6179.26854-prerelease" targetFramework="net45" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.7.0" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public class NewAzureRmServiceBusQueue : AzureServiceBusCmdletBase
[ValidateNotNullOrEmpty]
public bool? DeadLetteringOnMessageExpiration { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Enable Batched Operations - value that indicates whether server-side batched operations are enabled")]
public SwitchParameter EnableBatchedOperations { get; set; }

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "EnableExpress - a value that indicates whether Express Entities are enabled. An express queue holds a message in memory temporarily before writing it to persistent storage.")]
[ValidateSet("TRUE", "FALSE", IgnoreCase = true)]
[ValidateNotNullOrEmpty]
Expand Down Expand Up @@ -118,43 +121,48 @@ public override void ExecuteCmdlet()
queueAttributes.EnablePartitioning = EnablePartitioning;

if (LockDuration != null)
queueAttributes.LockDuration = LockDuration;
{ queueAttributes.LockDuration = LockDuration; }

if (AutoDeleteOnIdle != null)
queueAttributes.AutoDeleteOnIdle = AutoDeleteOnIdle;
{ queueAttributes.AutoDeleteOnIdle = AutoDeleteOnIdle; }

if (DefaultMessageTimeToLive != null)
queueAttributes.DefaultMessageTimeToLive = DefaultMessageTimeToLive;
{ queueAttributes.DefaultMessageTimeToLive = DefaultMessageTimeToLive; }

if (DuplicateDetectionHistoryTimeWindow != null)
queueAttributes.DuplicateDetectionHistoryTimeWindow = DuplicateDetectionHistoryTimeWindow;
{ queueAttributes.DuplicateDetectionHistoryTimeWindow = DuplicateDetectionHistoryTimeWindow; }

if (DeadLetteringOnMessageExpiration != null)
queueAttributes.DeadLetteringOnMessageExpiration = DeadLetteringOnMessageExpiration;
{ queueAttributes.DeadLetteringOnMessageExpiration = DeadLetteringOnMessageExpiration; }

if (MaxSizeInMegabytes != null)
queueAttributes.MaxSizeInMegabytes = (int?)MaxSizeInMegabytes;
queueAttributes.EnableBatchedOperations = EnableBatchedOperations.IsPresent;

if (EnableExpress != null)
{ queueAttributes.EnableExpress = EnableExpress; }

if (MaxDeliveryCount != null)
queueAttributes.MaxDeliveryCount = MaxDeliveryCount;
{ queueAttributes.MaxDeliveryCount = MaxDeliveryCount; }

if (MaxSizeInMegabytes != null)
{ queueAttributes.MaxSizeInMegabytes = (int?)MaxSizeInMegabytes; }

if (MessageCount != null)
queueAttributes.MessageCount = MessageCount;
{ queueAttributes.MessageCount = MessageCount; }

if (RequiresDuplicateDetection != null)
queueAttributes.RequiresDuplicateDetection = RequiresDuplicateDetection;
{ queueAttributes.RequiresDuplicateDetection = RequiresDuplicateDetection; }

if (RequiresSession != null)
queueAttributes.RequiresSession = RequiresSession;
{ queueAttributes.RequiresSession = RequiresSession; }

if (SizeInBytes != null)
queueAttributes.SizeInBytes = SizeInBytes;
{ queueAttributes.SizeInBytes = SizeInBytes; }

if (ForwardTo != null)
queueAttributes.ForwardTo = ForwardTo;
{ queueAttributes.ForwardTo = ForwardTo; }

if (ForwardDeadLetteredMessagesTo != null)
queueAttributes.ForwardDeadLetteredMessagesTo = ForwardDeadLetteredMessagesTo;
{ queueAttributes.ForwardDeadLetteredMessagesTo = ForwardDeadLetteredMessagesTo; }


if (ShouldProcess(target: Name, action: string.Format(Resources.CreateQueue, Name, Namespace)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ public class NewAzureRmServiceBusSubscription : AzureServiceBusCmdletBase
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Dead Lettering On Message Expiration")]
[ValidateSet("TRUE", "FALSE", IgnoreCase = true)]
[ValidateNotNullOrEmpty]
public bool? DeadLetteringOnMessageExpiration { get; set; }
public bool? DeadLetteringOnMessageExpiration { get; set; }

[Parameter(Mandatory = false, HelpMessage = "Value that indicates whether a subscription has dead letter support on filter evaluation exceptions.")]
public SwitchParameter DeadLetteringOnFilterEvaluationExceptions { get; set; }

[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Enable Batched Operations - value that indicates whether server-side batched operations are enabled")]
[ValidateSet("TRUE", "FALSE", IgnoreCase = true)]
Expand Down Expand Up @@ -89,40 +92,37 @@ public override void ExecuteCmdlet()
{

PSSubscriptionAttributes subAttributes = new PSSubscriptionAttributes();

PSNamespaceAttributes getNamespaceLoc = Client.GetNamespace(ResourceGroupName, Namespace);


subAttributes.Name = Name;

if (AutoDeleteOnIdle != null)
subAttributes.AutoDeleteOnIdle = AutoDeleteOnIdle;
{ subAttributes.AutoDeleteOnIdle = AutoDeleteOnIdle; }

if (DefaultMessageTimeToLive != null)
subAttributes.DefaultMessageTimeToLive = DefaultMessageTimeToLive;
{ subAttributes.DefaultMessageTimeToLive = DefaultMessageTimeToLive; }

if (LockDuration != null)
subAttributes.LockDuration = LockDuration;
{ subAttributes.LockDuration = LockDuration; }

if (DeadLetteringOnMessageExpiration != null)
subAttributes.DeadLetteringOnMessageExpiration = DeadLetteringOnMessageExpiration;
{ subAttributes.DeadLetteringOnMessageExpiration = DeadLetteringOnMessageExpiration; }

if (EnableBatchedOperations != null)
subAttributes.EnableBatchedOperations = EnableBatchedOperations;
subAttributes.DeadLetteringOnFilterEvaluationExceptions = DeadLetteringOnFilterEvaluationExceptions.IsPresent;

if (DeadLetteringOnMessageExpiration != null)
subAttributes.DeadLetteringOnMessageExpiration = DeadLetteringOnMessageExpiration;
if (EnableBatchedOperations != null)
{ subAttributes.EnableBatchedOperations = EnableBatchedOperations; }

if (MaxDeliveryCount != null)
subAttributes.MaxDeliveryCount = MaxDeliveryCount;
{ subAttributes.MaxDeliveryCount = MaxDeliveryCount; }

if (RequiresSession != null)
subAttributes.RequiresSession = RequiresSession;
{ subAttributes.RequiresSession = RequiresSession; }

if (ForwardTo != null)
subAttributes.ForwardTo = ForwardTo;
{ subAttributes.ForwardTo = ForwardTo; }

if (ForwardDeadLetteredMessagesTo != null)
subAttributes.ForwardDeadLetteredMessagesTo = ForwardDeadLetteredMessagesTo;
{ subAttributes.ForwardDeadLetteredMessagesTo = ForwardDeadLetteredMessagesTo; }

if (ShouldProcess(target: Name, action: string.Format(Resources.CreateSubscription, Name, Topic,Namespace)))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,40 +95,35 @@ public override void ExecuteCmdlet()

topicAttributes.Name = Name;

if(EnablePartitioning != null)
topicAttributes.EnablePartitioning = EnablePartitioning;

if (EnablePartitioning != null)
{ topicAttributes.EnablePartitioning = EnablePartitioning; }

if (AutoDeleteOnIdle != null)
topicAttributes.AutoDeleteOnIdle = AutoDeleteOnIdle;
{ topicAttributes.AutoDeleteOnIdle = AutoDeleteOnIdle; }

if (DefaultMessageTimeToLive != null)
topicAttributes.DefaultMessageTimeToLive = DefaultMessageTimeToLive;
{ topicAttributes.DefaultMessageTimeToLive = DefaultMessageTimeToLive; }

if (DuplicateDetectionHistoryTimeWindow != null)
topicAttributes.DuplicateDetectionHistoryTimeWindow = DuplicateDetectionHistoryTimeWindow;

{ topicAttributes.DuplicateDetectionHistoryTimeWindow = DuplicateDetectionHistoryTimeWindow; }

if (EnableBatchedOperations != null)
topicAttributes.EnableBatchedOperations = EnableBatchedOperations;


{ topicAttributes.EnableBatchedOperations = EnableBatchedOperations; }

if (EnableExpress != null)
topicAttributes.EnableExpress = EnableExpress;

{ topicAttributes.EnableExpress = EnableExpress; }

if (MaxSizeInMegabytes != null)
topicAttributes.MaxSizeInMegabytes = (int?)MaxSizeInMegabytes;
{ topicAttributes.MaxSizeInMegabytes = (int?)MaxSizeInMegabytes; }

if (RequiresDuplicateDetection != null)
topicAttributes.RequiresDuplicateDetection = RequiresDuplicateDetection;
{ topicAttributes.RequiresDuplicateDetection = RequiresDuplicateDetection; }

if (SupportOrdering != null)
topicAttributes.SupportOrdering = SupportOrdering;
{ topicAttributes.SupportOrdering = SupportOrdering; }

if (SizeInBytes != null)
topicAttributes.SizeInBytes = SizeInBytes;
{ topicAttributes.SizeInBytes = SizeInBytes; }

if (ShouldProcess(target: Name, action: string.Format(Resources.CreateTopic, Name, Namespace)))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public override void ExecuteCmdlet()
if (InputObject != null)
{
topicAttributes = InputObject;
}
}

if (ShouldProcess(target: Name, action: string.Format(Resources.UpdateTopic, Name, Namespace)))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Azure.Management.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ServiceBus.1.0.3\lib\net452\Microsoft.Azure.Management.ServiceBus.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ServiceBus.1.1.0\lib\net452\Microsoft.Azure.Management.ServiceBus.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Management.Automation" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public PSQueueAttributes(SBQueue quResource)
UpdatedAt = quResource.UpdatedAt;
ForwardTo = quResource.ForwardTo;
ForwardDeadLetteredMessagesTo = quResource.ForwardDeadLetteredMessagesTo;
EnableBatchedOperations = quResource.EnableBatchedOperations;

}
}
Expand Down Expand Up @@ -178,6 +179,12 @@ public PSQueueAttributes(SBQueue quResource)
/// </summary>
public string ForwardDeadLetteredMessagesTo { get; set; }

/// <summary>
/// Value that indicates whether server-side batched operations are
/// enabled..
/// </summary>
public bool? EnableBatchedOperations { get; set; }


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public PSSubscriptionAttributes(SBSubscription subscriptionResource)
Name = subscriptionResource.Name;
ForwardTo = subscriptionResource.ForwardTo;
ForwardDeadLetteredMessagesTo = subscriptionResource.ForwardDeadLetteredMessagesTo;
DeadLetteringOnFilterEvaluationExceptions = subscriptionResource.DeadLetteringOnFilterEvaluationExceptions;
}
}

Expand Down Expand Up @@ -137,5 +138,10 @@ public PSSubscriptionAttributes(SBSubscription subscriptionResource)
/// </summary>
public string ForwardDeadLetteredMessagesTo { get; set; }

/// <summary>
/// Value that indicates whether a subscription has dead letter support on filter evaluation exceptions.
/// </summary>
public bool? DeadLetteringOnFilterEvaluationExceptions { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ public PSTopicAttributes(SBTopic topicResource)
/// <summary>
/// Queue name.
/// </summary>
public string Name { get; set; }


public string Name { get; set; }

/// <summary>
/// Id of the resource.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ public PSQueueAttributes CreateUpdateQueue(string resourceGroupName, string name
parameters.DeadLetteringOnMessageExpiration = queue.DeadLetteringOnMessageExpiration;
if (queue.EnableExpress.HasValue)
parameters.EnableExpress = queue.EnableExpress;
if (queue.EnableBatchedOperations.HasValue)
parameters.EnableBatchedOperations = queue.EnableBatchedOperations;
if (queue.EnablePartitioning.HasValue)
parameters.EnablePartitioning = queue.EnablePartitioning;
if (queue.MaxDeliveryCount.HasValue)
Expand Down Expand Up @@ -456,6 +458,8 @@ public PSSubscriptionAttributes CreateUpdateSubscription(string resourceGroupNam
parameters.LockDuration = (TimeSpan?)AzureServiceBusCmdletBase.ParseTimespan(subscription.LockDuration);
if (subscription.DeadLetteringOnMessageExpiration.HasValue)
parameters.DeadLetteringOnMessageExpiration = subscription.DeadLetteringOnMessageExpiration;
if (subscription.DeadLetteringOnFilterEvaluationExceptions.HasValue)
parameters.DeadLetteringOnFilterEvaluationExceptions = subscription.DeadLetteringOnFilterEvaluationExceptions;
if (subscription.EnableBatchedOperations.HasValue)
parameters.EnableBatchedOperations = subscription.EnableBatchedOperations;
if (subscription.MaxDeliveryCount.HasValue)
Expand Down
Loading