public static void GetUpdatedMRSRequestInfo(RequestStatisticsBase requestJob, bool diagnostic, string diagnosticArgument) { MoveRequestInfo requestInfo = null; CommonUtils.CatchKnownExceptions(delegate { string mrsServer = MailboxReplicationServiceClient.GetMrsServer(requestJob.WorkItemQueueMdb.ObjectGuid); using (MailboxReplicationServiceClient mailboxReplicationServiceClient = MailboxReplicationServiceClient.Create(mrsServer)) { requestInfo = mailboxReplicationServiceClient.GetMoveRequestInfo(requestJob.IdentifyingGuid); requestJob.UpdateThroughputFromMoveRequestInfo(requestInfo); if (RequestTaskHelper.NeedToUpdateJobPickupMessage()) { requestJob.UpdateMessageFromMoveRequestInfo(requestInfo); } if (diagnostic) { string jobPickupFailureMessage = (requestInfo == null) ? string.Empty : requestInfo.Message.ToString(); requestJob.PopulateDiagnosticInfo(new RequestStatisticsDiagnosticArgument(diagnosticArgument), jobPickupFailureMessage); } } }, null); }
public static MRSHealthCheckOutcome VerifyServiceIsRespondingToRPCPing(string serverName, TestMRSHealth testMRSCmdlet = null) { MRSHealthCheckOutcome outcome = null; CommonUtils.CatchKnownExceptions(delegate { MailboxReplicationServiceClient mailboxReplicationServiceClient2; MailboxReplicationServiceClient mailboxReplicationServiceClient = mailboxReplicationServiceClient2 = MailboxReplicationServiceClient.Create(serverName); try { outcome = new MRSHealthCheckOutcome(serverName, MRSHealthCheckId.RPCPingCheck, true, Strings.MailboxReplicationServiceIsRespondingToRPCPing(mailboxReplicationServiceClient.ServerVersion.ToString())); } finally { if (mailboxReplicationServiceClient2 != null) { ((IDisposable)mailboxReplicationServiceClient2).Dispose(); } } }, delegate(Exception ex) { if (testMRSCmdlet != null) { testMRSCmdlet.MonitoringData.Events.Add(new MonitoringEvent("MSExchange Monitoring MRSHealth", 1002, EventTypeEnumeration.Error, Strings.MailboxReplicationServiceNotResponding(CommonUtils.FullExceptionMessage(ex, true)))); } outcome = new MRSHealthCheckOutcome(serverName, MRSHealthCheckId.RPCPingCheck, false, Strings.MailboxReplicationServiceNotResponding(CommonUtils.FullExceptionMessage(ex, true))); }); return(outcome); }
protected virtual void InitializeMRSClient() { this.MRSClient = MailboxReplicationServiceClient.Create(this.ConfigSession, MRSJobType.RequestJobE15_TenantHint, this.MdbId.ObjectGuid, this.UnreachableMrsServers); }