Help shape the future of CMS PaaS release notes! Take this quick survey and share your feedback. 

Shahram Shahinzadeh
Apr 26, 2010
  10249
(0 votes)

MoM Server

Summary

The MoM server or Monitoring on Mirroring server monitors mirroring jobs during mirroring. The MOM server notifies about status of an individual package, warnings, errors messages and etc. This article describes anatomy of the MOM Server and in continue shows an example of client to the MOM Server.

 

MOM Server or Publisher

The MOM server is based on WCF and uses Duplex Communication channel. The concept is based on Publisher (MOM Server) and Subscribers (MoM Clients). The MoM server belongs to the Mirroring Server whom creates and activates it. The MOM server has a list of subscribers and as soon as a state of mirroring job changes then the MOM server sends a notification to subscribers. If the subscriber is unreliable or is not active then the MOM Server removes the client from the subscriber list. The MOM Server has working thread for sending events to subscriber which does not causes blocking on the mirroring server during state notifying. All events are cached on the monitoring server and the size of it is 10000 events in memory.

 

Mirroring States

There is a state machine inside mirroring server and for each state changing sends an event. For instance when mirroring job initialized and pass validation then sends the MirroringJobInitialized event or when one of mirroring packages is completed sends the MirroringPackageCompleted event and etc. The MoM Server sends corresponding event for each state changing.

 

 

MirroringStatusEventArgs

All necessary information about a mirroring job can be found in the MirroringStatusEventArgs.
For a subscriber might all information is not necessary.
The MirroringStatusEventArgs contains a Guid which is the mirroring job id or channel id and MirroringTransferData.
The MirroringTransferData contains of MirroringInitializeData, MirroringPackageBody, MirroringPackageHeader and MirroringStatus.
The MirroringInitializeData contains Name, DestinationPageGuid, DestinationPath, DestinationRoot, LastExecution, NrOfFilesinPackage, NrOfPagesInPackages and etc.
The MirroringPackageHeader contains FileSize, TargetFilePath, SizeOfSentData, SizeOfReceiveData.

The MirroringStatus contains MirroringState and StatusLog (contains information about Warning and Error etc).
SentTime time of start of state changing, ReceivedTime time of end of state changing.

 

Subscriber

A subscriber can use the EPiServer.MirroringService.MirroringMonitoring .MirroringMonitoringClient helper class. The subscriber receives events via the MirroringTransferStatusEventHandler. The subscriber subscribes on all mirroring jobs by calling Subscribe () . To make a subscription against the MOM server there are two approaches. The first approach is the application has responsibility to call Subscribe when the monitoring server restarts. The application creates an instance of MirroringMonitoringClient with an endpointName which is defined in app.config and call subscribe on it. See code example blow.

   1: MirroringMonitoringClient momClient = new MirroringMonitoringClient(endPointName);  // endPointName is defined in web config
   2: momClient.MirroringTransferStatusEventHandler += new MirroringStatusEventHandler(TransferEventCatcher); 
   3: momClient.Subscribe();
   4:  

Or creates an instance of MirroringMonitoringClient with autoReconnect flag which check if the monitoring server is alive. And with this approach the application does not need to act on monitoring server failure scenarion. See code example blow.

   1: bool autoReconnect = true;
   2: MirroringMonitoringClient momClient = new MirroringMonitoringClient(endPointName, autoReconnect); 
   3: momClient.MirroringTransferStatusEventHandler += new MirroringStatusEventHandler(TransferEventCatcher);
   4: momClient.Period=20000; // 20 sec. 

To receive status of the MoM server the application has to add event handler to the static ServiceConnectionEventHandler event.

   1: MirroringMonitoringClient.ServiceConnectionEventHandler += new ServiceConnectionEventHandler(MirroringMonitoringClient_ServiceConnectionEventHandler);
   2:  
Apr 26, 2010

Comments

Please login to comment.
Latest blogs
Be careful with your (order) notes

This happened a quite ago but only now I have had time to write about it. Once upon a time, I was asked to look into a customer database (in a big...

Quan Mai | Feb 5, 2025 | Syndicated blog

Imagevault download picker

This open source extension enables you to download images as ImageData with ContentReference from the ImageVault picker. It serves as an alternativ...

Luc Gosso (MVP) | Feb 4, 2025 | Syndicated blog

Optimizely SaaS vs PaaS: A Comparison from Client and Developer Perspectives

Optimizely, one of the leading digital experience platform. Offering both Software-as-a-Service (SaaS) and Platform-as-a-Service (PaaS) solutions....

Praful Jangid | Feb 3, 2025

Returning to Optimizely After Many Years

Returning to Optimizely After Many Years: A Journey Through Its New Features After several years away from Optimizely’s Content Management … More

Jose Neto | Feb 2, 2025 | Syndicated blog

Aspiring Optimizely

Adding .NET Aspire application host to your Optimizely project (even if it’s just for local development) is really a time-saver when it comes to...

valdis | Feb 2, 2025 | Syndicated blog

My Journey to Optimizely Certification: Study Tips, AI Tools, and Exam Strategies

How I Prepared for My Optimizely Certification Exam Hello everyone, I recently took the Optimizely Certification Developer Exam and became certifie...

calimat | Jan 31, 2025