Current I'm using Microsoft.Azure.ServiceBus.IQueueClient
to RegisterMessageHandler
, and then the message I receive is of type Microsoft.Azure.ServiceBus.Message
.
According to the documentation:
Message deferral APIs The API is BrokeredMessage.Defer or BrokeredMessage.DeferAsync in the .NET Framework client, MessageReceiver.DeferAsync in the .NET Standard client, and IMessageReceiver.defer or IMessageReceiver.deferAsync in the Java client.
...but none of those libraries seam to relate to the classes I'm actually using. How do I defer? What classes and stuff do I have to use in order to be able to defer messages? All the samples above dont give enough code snippets to explain it.
Update as requested by @Gaurav
from your answer, I can see my message has that property:
message.ScheduledEnqueueTimeUtc = DateTime.UtcNow.AddHours(1);
but the queueClient
also has this method:
queueClient.ScheduleMessageAsync(message, DateTime.UtcNow.AddHours(1));
I'm going to try 'scheduledMessageAsync
' as I cant see how to communicate that I've set ScheduledEnqueueTimeUtc
without calling the queueClient