I'm trying to add a delay on the message which is present on the service bus queue using java .So that after the delay the same message can be consumed for processing by the function app.
Can anyone suggest me the sample code or links for the same ?
AFAIK, it is not possible to add delay to a message that is already present in a Service Bus Queue.
Each Service Bus Message has a ScheduledEnqueueTimeUtc
property that can be set when a message is sent to the Queue which will ensure that the message will appear in the Queue at that time only so that it can be consumed.
However you cannot change this property for an existing message. What you can do is resubmit a message (essentially create a copy of the original message) with a desired value set for ScheduledEnqueueTimeUtc
property. Please take a look at public CompletableFuture scheduleMessageAsync(IMessage message, Instant scheduledEnqueueTimeUtc)
for more details.