0
votes

I have an asp.net application that allows a group of students to reserve "rooms". Each room is setup with its own exchange account so when a student reserves a room an EWS call is made to create an appointment on the calendar. Using jquery we display open timeslots so that the student can only book available times.

After experiencing high traffic and competition for the same timeslots I had to address simultaneous reservations. My thought was that I could just pause the main thread, make a call to find the reservation i just made, verify accept from the room, return "confirmed appointment" to the user that got the accept and "denied appointment" to the user who got the decline. I found partial success because EWS is not reliable in returning a response everytime. Sometimes a user would get a response unknown while the room would accept the appointment by email. The application lives and dies off the response from EWS and it seems that in high traffic with alot of simultaneous transactions, EWS cant respond to my calls. Funny thing though all other departments that have very little traffic love the app and it works great for them:(

My thought is that I need to Queue my EWS calls.

Can anyone give me some guidance on managing EWS simultaneous calls for the same/different resource and time?

Has anyone ever queued up an EWS user transaction (create appointment, confirm appointment and delete appointment if condition calls)?

1

1 Answers

2
votes

As far as I know there isn't a way to queue up requests natively within EWS. Your best bet is probably going to be to use some form of lock on your server to make sure that only one request is executing at a time.

Alternatively, you could make use of the Tasks functionality within .NET and queue up commands this way. Making use of the LimitedConcurrencyLevelTaskScheduler will mean that you can limit the number of requests that are executing. It will also allow you to configure this should you find you can process 3 requests at a time. More details and a code sample can be found here.

You'll have to bear in mind that any requests queued will cease to exist should the app pool be recycled for any reason.