Skip to content

Cannot delete a message after dequeue #9183

@takaz-ams

Description

@takaz-ams

I am using azure storage queues to push messages then i ma running an aspnet core worker app to process the queue. After successfully getting a message and logging it to the db, i can delete the message. The app then hangs at that line and never returns. This like is the main issue:

await _queueViews.DeleteMessageAsync(msgClick);
here is the rest of the code

CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
_queueClicks = queueClient.GetQueueReference(ClicksQueue);
_queueViews = queueClient.GetQueueReference(ItemViewsQueue);
_queueClicks.CreateIfNotExistsAsync();
_queueViews.CreateIfNotExistsAsync();

....
....
..
var msgClick = await _queueClicks.GetMessageAsync();
if (!(msgClick is null))
{
var content = JsonConvert.DeserializeObject(msgClick.AsString);
if (content != null && content.ItemClickLog != null)
{
if (!await _context.ShopItemClickLogs.AnyAsync(a => a.Id == content.ItemClickLog.Id))
{
await _context.ShopItemClickLogs.AddAsync(content.ItemClickLog);
await _context.SaveChangesAsync(stoppingToken).ConfigureAwait(false);
}
try
{
await _queueViews.DeleteMessageAsync(msgClick);
}
catch (AggregateException axp)
{
_logger.LogError(axp.Message);
}
}
}

Metadata

Metadata

Assignees

Labels

ClientThis issue is related to a non-management packageService AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions