Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add selective delete to Transfer deadletter subqueues and fix the context menus for the Transfer Deadletter grid view #768

Merged
Show file tree
Hide file tree
Changes from 3 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
20 changes: 16 additions & 4 deletions src/Common/Helpers/DeadLetterMessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public DeadLetterMessageHandler(WriteToLogDelegate writeToLog, ServiceBusHelper
#endregion

#region Public methods
public async Task<DeletedDlqMessagesResult> DeleteMessages(List<long?> sequenceNumbers)
public async Task<DeletedDlqMessagesResult> DeleteMessages(List<long?> sequenceNumbers,
bool TransferDLQ)
{
var sequenceNumbersToDeleteList = new List<long?>();
foreach (var number in sequenceNumbers)
Expand All @@ -96,7 +97,7 @@ public async Task<DeletedDlqMessagesResult> DeleteMessages(List<long?> sequenceN
}

var timedOut = false;
var dlqEntityPath = GetDlqEntityPath();
var dlqEntityPath = TransferDLQ ? GetTransferDlqEntityPath() : GetDlqEntityPath();

var messageReceiver = await serviceBusHelper.MessagingFactory.CreateMessageReceiverAsync(
dlqEntityPath,
Expand Down Expand Up @@ -185,7 +186,7 @@ public async Task<DeletedDlqMessagesResult> DeleteMessages(List<long?> sequenceN


public async Task<DeletedDlqMessagesResult> MoveMessages(MessageSender messageSender,
List<long> sequenceNumbers, List<BrokeredMessage> messagesToSend = null)
List<long> sequenceNumbers, bool transferDLQ, List<BrokeredMessage> messagesToSend = null)
{
if (messagesToSend != null)
{
Expand All @@ -196,7 +197,7 @@ public async Task<DeletedDlqMessagesResult> MoveMessages(MessageSender messageSe
}
}

var dlqEntityPath = GetDlqEntityPath();
var dlqEntityPath = transferDLQ ? GetTransferDlqEntityPath() : GetDlqEntityPath();

var messageReceiver = serviceBusHelper.MessagingFactory.CreateMessageReceiver(
dlqEntityPath,
Expand Down Expand Up @@ -368,6 +369,17 @@ string GetDlqEntityPath()
sourceSubscriptionWrapper.SubscriptionDescription.TopicPath,
sourceSubscriptionWrapper.SubscriptionDescription.Name);
}

string GetTransferDlqEntityPath()
{
if (sourceQueueDescription != null)
{
return QueueClient.FormatTransferDeadLetterPath(sourceQueueDescription.Path);
}

throw new Exception("It is currently not supported getting a Transfer Dead-letter queue for a subscription.");
}

void WriteToLog(string message)
{
if (writeToLog != null && !string.IsNullOrWhiteSpace(message))
Expand Down
248 changes: 86 additions & 162 deletions src/ServiceBusExplorer/Controls/HandleQueueControl.Designer.cs

Large diffs are not rendered by default.

Loading
Loading