-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Changed icon url in nuget.spec (#520) Added nuget.spec to the main project * Changes the main window's text/title to ASB namespace. (#524) * Changes the main window's text/title to ASB namespace when ASB connection is made. This brings more visibility when working with mulitple ASB connections at the same time. * Added SDK information for contributing (#533) * Purge All Topics / Subscriptions (#531) * basic implmentation for purge all subscriptions from all topics * reordered and renamed Purge All context menu items * purge confirmation prompts * error handling for subscription purge operations * changed to official speling for dead-letter * bulk purge for queues * moved BulkPurger to ServiceBus library and removed it's internal usage of old SDK * merged ServiceBusPurger with BulkPurger - wip * split ServiceBusPurger into entity specific classes * removed old ServiceBusPurger * moved concrete classes to own files * PR feedback * moved event hanlder arg classes to own files * added missing ConfigureAwaits * possible fix for scaling issue * added Purge All option for individual queues / subscriptions * added Purge All option for individual queues / subscriptions * handling for queue / topic folders * made DeleteForm to be displayed in the center of the parent regardless of the parent's position Co-authored-by: Razvan Goga <[email protected]> * fix alt-ctrl-del interpreted as delete (#536) Co-authored-by: Taruia Matara <[email protected]> * Bump System.Text.Encodings.Web from 4.6.0 to 4.7.2 in /src/Common (#537) Bumps [System.Text.Encodings.Web](https://github.com/dotnet/corefx) from 4.6.0 to 4.7.2. - [Release notes](https://github.com/dotnet/corefx/releases) - [Commits](https://github.com/dotnet/corefx/commits) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Change PurgeDeadletterQueueMessagesAsync purge strategy to PurgeStrategies.DeadletteredMessages. (#542) * Add Async to listing methods Co-authored-by: Erik Mogensen <[email protected]> Co-authored-by: groozin <[email protected]> Co-authored-by: Razvan Goga <[email protected]> Co-authored-by: Razvan Goga <[email protected]> Co-authored-by: Adam <[email protected]> Co-authored-by: Taruia Matara <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: avalanchis <[email protected]> Co-authored-by: Björn Göransson <[email protected]>
- Loading branch information
1 parent
4c17cef
commit 8fd1d40
Showing
27 changed files
with
2,253 additions
and
1,364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/ServiceBus/Helpers/PurgeOperationCompletedEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#region Copyright | ||
//======================================================================================= | ||
// Microsoft Azure Customer Advisory Team | ||
// | ||
// This sample is supplemental to the technical guidance published on my personal | ||
// blog at http://blogs.msdn.com/b/paolos/. | ||
// | ||
// Author: Paolo Salvatori | ||
//======================================================================================= | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// | ||
// LICENSED UNDER THE APACHE LICENSE, VERSION 2.0 (THE "LICENSE"); YOU MAY NOT USE THESE | ||
// FILES EXCEPT IN COMPLIANCE WITH THE LICENSE. YOU MAY OBTAIN A COPY OF THE LICENSE AT | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE DISTRIBUTED UNDER THE | ||
// LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, EITHER EXPRESS OR IMPLIED. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING | ||
// PERMISSIONS AND LIMITATIONS UNDER THE LICENSE. | ||
//======================================================================================= | ||
#endregion | ||
|
||
using System; | ||
|
||
namespace ServiceBusExplorer.ServiceBus.Helpers | ||
{ | ||
public class PurgeOperationCompletedEventArgs : EventArgs | ||
{ | ||
public bool IsDeadLetterQueue { get; set; } | ||
public string EntityPath { get; set; } | ||
public long ElapsedMilliseconds { get; set; } | ||
public long TotalMessagesPurged { get; set; } | ||
|
||
public PurgeOperationCompletedEventArgs(string entityPath, long elapsedMilliseconds, long totalMessagesPurged, bool isDeadLetterQueue) | ||
{ | ||
this.EntityPath = entityPath; | ||
this.ElapsedMilliseconds = elapsedMilliseconds; | ||
this.TotalMessagesPurged = totalMessagesPurged; | ||
this.IsDeadLetterQueue = isDeadLetterQueue; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#region Copyright | ||
//======================================================================================= | ||
// Microsoft Azure Customer Advisory Team | ||
// | ||
// This sample is supplemental to the technical guidance published on my personal | ||
// blog at http://blogs.msdn.com/b/paolos/. | ||
// | ||
// Author: Paolo Salvatori | ||
//======================================================================================= | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// | ||
// LICENSED UNDER THE APACHE LICENSE, VERSION 2.0 (THE "LICENSE"); YOU MAY NOT USE THESE | ||
// FILES EXCEPT IN COMPLIANCE WITH THE LICENSE. YOU MAY OBTAIN A COPY OF THE LICENSE AT | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE DISTRIBUTED UNDER THE | ||
// LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, EITHER EXPRESS OR IMPLIED. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING | ||
// PERMISSIONS AND LIMITATIONS UNDER THE LICENSE. | ||
//======================================================================================= | ||
#endregion | ||
|
||
using System; | ||
|
||
namespace ServiceBusExplorer.ServiceBus.Helpers | ||
{ | ||
public class PurgeOperationFailedEventArgs : EventArgs | ||
{ | ||
public Exception Exception { get; set; } | ||
|
||
public PurgeOperationFailedEventArgs(Exception exception) | ||
{ | ||
this.Exception = exception; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#region Copyright | ||
//======================================================================================= | ||
// Microsoft Azure Customer Advisory Team | ||
// | ||
// This sample is supplemental to the technical guidance published on my personal | ||
// blog at http://blogs.msdn.com/b/paolos/. | ||
// | ||
// Author: Paolo Salvatori | ||
//======================================================================================= | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// | ||
// LICENSED UNDER THE APACHE LICENSE, VERSION 2.0 (THE "LICENSE"); YOU MAY NOT USE THESE | ||
// FILES EXCEPT IN COMPLIANCE WITH THE LICENSE. YOU MAY OBTAIN A COPY OF THE LICENSE AT | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE DISTRIBUTED UNDER THE | ||
// LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, EITHER EXPRESS OR IMPLIED. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING | ||
// PERMISSIONS AND LIMITATIONS UNDER THE LICENSE. | ||
//======================================================================================= | ||
#endregion | ||
|
||
using System; | ||
|
||
namespace ServiceBusExplorer.ServiceBus.Helpers | ||
{ | ||
[Flags] | ||
public enum PurgeStrategies | ||
{ | ||
Messages = 1, | ||
DeadletteredMessages = 2, | ||
All = Messages | DeadletteredMessages | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#region Copyright | ||
//======================================================================================= | ||
// Microsoft Azure Customer Advisory Team | ||
// | ||
// This sample is supplemental to the technical guidance published on my personal | ||
// blog at http://blogs.msdn.com/b/paolos/. | ||
// | ||
// Author: Paolo Salvatori | ||
//======================================================================================= | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// | ||
// LICENSED UNDER THE APACHE LICENSE, VERSION 2.0 (THE "LICENSE"); YOU MAY NOT USE THESE | ||
// FILES EXCEPT IN COMPLIANCE WITH THE LICENSE. YOU MAY OBTAIN A COPY OF THE LICENSE AT | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE DISTRIBUTED UNDER THE | ||
// LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, EITHER EXPRESS OR IMPLIED. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING | ||
// PERMISSIONS AND LIMITATIONS UNDER THE LICENSE. | ||
//======================================================================================= | ||
#endregion | ||
|
||
using Azure.Messaging.ServiceBus; | ||
using Azure.Messaging.ServiceBus.Administration; | ||
using System.Threading.Tasks; | ||
|
||
namespace ServiceBusExplorer.ServiceBus.Helpers | ||
{ | ||
public class QueueServiceBusPurger : ServiceBusPurger<QueueProperties> | ||
{ | ||
public QueueServiceBusPurger(ServiceBusHelper2 serviceBusHelper) : base(serviceBusHelper) { } | ||
|
||
protected override ServiceBusReceiver CreateServiceBusReceiver(QueueProperties entity, ServiceBusClient client, bool purgeDeadLetterQueueInstead) | ||
{ | ||
return client.CreateReceiver( | ||
entity.Name, | ||
new ServiceBusReceiverOptions | ||
{ | ||
PrefetchCount = 50, | ||
ReceiveMode = ServiceBusReceiveMode.ReceiveAndDelete, | ||
SubQueue = purgeDeadLetterQueueInstead ? SubQueue.DeadLetter : SubQueue.None | ||
}); | ||
} | ||
|
||
protected async override Task<ServiceBusSessionReceiver> CreateServiceBusSessionReceiver(QueueProperties entity, ServiceBusClient client, bool purgeDeadLetterQueueInstead) | ||
{ | ||
return await client.AcceptNextSessionAsync( | ||
entity.Name, | ||
new ServiceBusSessionReceiverOptions | ||
{ | ||
PrefetchCount = 10, | ||
ReceiveMode = ServiceBusReceiveMode.ReceiveAndDelete | ||
}) | ||
.ConfigureAwait(false); | ||
} | ||
|
||
protected override bool EntityRequiresSession(QueueProperties entity) | ||
{ | ||
return entity.RequiresSession; | ||
} | ||
|
||
protected override string GetEntityPath(QueueProperties entity) | ||
{ | ||
return entity.Name; | ||
} | ||
|
||
protected async override Task<long> GetMessageCount(QueueProperties entity, bool deadLetterQueueData) | ||
{ | ||
var client = new ServiceBusAdministrationClient(serviceBusHelper.ConnectionString); | ||
|
||
if (deadLetterQueueData) | ||
{ | ||
var runtimeInfoResponse = await client.GetQueueRuntimePropertiesAsync(entity.Name) | ||
.ConfigureAwait(false); | ||
|
||
return runtimeInfoResponse.Value.DeadLetterMessageCount; | ||
} | ||
else | ||
{ | ||
var runtimeInfo = await client.GetQueueRuntimePropertiesAsync(entity.Name) | ||
.ConfigureAwait(false); | ||
|
||
return runtimeInfo.Value.ActiveMessageCount; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.