I'm having an issue with my function below that adds a scheduled message to a Azure service bus queue. The creation method poops out when calling the method
var sendCodeSequence = await queueClient.ScheduleMessageAsync(message,
new DateTimeOffset(endTime));
and no exception is thrown up the stack in my controller even though the message gets added to the queue!
My question?
if I'm using the same message id multiple times across different queues all on the same service bus will I run into problems creating and deleting them on each queue, even though they all have different sequence ids?
I'm using a message id in the the brokered message contructor and message id property, is this ok or will this cause issues of adding more and deleting them off the queues?
ex. I have 5 different queues on the same service bus namespace. And might add 5 different messages, one to each queue, all with the same brokered message id. So, don't know if this will cause any issues?
Here is a method I'm using to add a scheduled message to a queue using my event id as the message id
public async Task <long> CreateHostPointCodeMessage(int eventId, YogaSpaceDuration duration, DateTime utcEventDateTime) {
string serviceBusConnectionString = System.Configuration.ConfigurationManager.AppSettings["ServiceBusConnectionString"];
string queueName = System.Configuration.ConfigurationManager.AppSettings["PreEventPointsCodeQueueName"];
var queueClient = QueueClient.CreateFromConnectionString(serviceBusConnectionString, queueName);
int length = Convert.ToInt16(EnumHelper.GetDisplayName(duration).Split(' ')[0]);
var endTime = DateTime.SpecifyKind(utcEventDateTime.AddMinutes(length).AddMinutes(-5), DateTimeKind.Utc);
BrokeredMessage message = new BrokeredMessage(eventId.ToString());
message.MessageId = eventId.ToString();
message.ScheduledEnqueueTimeUtc = endTime;
var sendCodeSequence = await queueClient.ScheduleMessageAsync(message, new DateTimeOffset(endTime));
await queueClient.CloseAsync();
return sendCodeSequence;
}
FYI - I'm using 'Microsoft.ServiceBus.Messaging' to send messages to the queue, but according to this MS article I should be using 'Microsoft.Azure.ServiceBus' I don't know if this makes any difference?