TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
venkatesh chava
NA
77
1.7k
Azure Service Bus
Jul 11 2019 7:31 AM
I just Want to send a message to Azure Service Bus With delayed process at particular time eg: after 2 hrs . how i can archive that please povide me an example. Thanks in advance.
So far i did like this but i am unable send the message to queue. i am getting status as Faulted.
public class ServiceBusQueueHelpers
{
string serviceBusConnectionString = "my Queue Connectionstring";
string sbQueueName = "Test Queue";
DateTime utcEnqueueTime = DateTime.UtcNow;
public static Microsoft.Azure.ServiceBus.QueueClient queueClient;
public async Task SendDelayedMessageAsync(string queue, string message, string serviceBusConnectionString, DateTime utcEnqueueTime)
{
ServiceBusConnectionStringBuilder sb = new ServiceBusConnectionStringBuilder(serviceBusConnectionString);
for (int i = 0; i < 2; i++)
{
Message queueMessage = new Message(Encoding.UTF8.GetBytes(message));
queueMessage.ScheduledEnqueueTimeUtc = utcEnqueueTime.AddSeconds(120);
Microsoft.Azure.ServiceBus.QueueClient client = new Microsoft.Azure.ServiceBus.QueueClient(sb, Microsoft.Azure.ServiceBus.ReceiveMode.ReceiveAndDelete);
await client.SendAsync(queueMessage);
await client.CloseAsync();
}
}
}
Reply
Answers (
2
)
MS Azure shared key by Azure REST API
Different types of cloud computing