I will be using managed EWS for Java to create a thread that performs tasks on our Exchange server as reactions to creation, modification and deletion of elements in certain folders for certain users.
I have a few questions regarding EWS:
StreamingSubscriptionConnection
can only be kept open for a maximum of 30 minutes. What is the correct solution to practically keep it open permanently? Close and reconnect every 29 minutes?After calling
connection.open()
, the thread that called it continues and would end. Currently I use an infiniteThread.Sleep()
afterconnection.open()
to keep the thread alive. What is the correct solution to keep the main thread alive?What happens if a thread having an open connection crashes? Will the connection on the exchange server stay open for the remaining timeout time? Is it safe to assume that a new connection created right after a crash will receive all subscribed events (or will it go to the old connection only?)? On the Exchange Server, how do I see how many EWS subscription connections are active?
Is a new thread created every time a
CreationDelegates
is used? As in is it automatically multi-threaded?
It's an Exchange 2013 server.