1

I have processor that takes messages from storage queue. This message has some visibillity timeout. But sometimes processor takes more time than timeout, so another instance of processor takes message to process again (second time it is not possible to go through all flow in processor as I have some validation). Second time message is processed faster than and became deleted before all flow is finished in first time.

But when flow is finished it also wants to delete message that is already deleted. As result I get error:

Message="Unable to translate bytes [92] at index -1 from specified code page to Unicode.

Is it possible to check if message is delete before trying to delete it second time?

2
  • Please specify if you're using Azure Storage Queue or Azure Service Bus Queue (I am guessing that you're using Storage Queues). Commented May 31, 2018 at 17:29
  • @GauravMantri, your guess is correct Commented Jun 1, 2018 at 0:22

1 Answer 1

1

The first thing to try is making the visibility timeout long enough that you can be sure the processing will finish before the timeout expires.

If that isn't an option or if you want additional safety, you can use CloudQueue.UpdateMessage() to increase the visibility timeout on the message.

https://learn.microsoft.com/en-us/dotnet/api/microsoft.windowsazure.storage.queue.cloudqueue.updatemessageasync?view=azure-dotnet

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.