Microsoft Dynamics CRM 2011 – Asynchronous Service Architecture

The asynchronous service executes long-running operations independent of the main Microsoft Dynamics CRM 2011 and Microsoft Dynamics CRM Online core operation. This results in improved overall system performance and improved scalability. The asynchronous service features a managed queue for the execution of asynchronous registered plug-ins, workflows, and operations such as bulk mail, bulk import, and campaign activity propagation. These operations are registered with the asynchronous service and executed periodically when the service processes its queue. The asynchronous service can be hosted on a server other that the server running Microsoft Dynamics CRM.

The Microsoft Dynamics CRM system architecture can be divided into three major components: the core system, which features the event execution pipeline, the database component, which hosts the asynchronous queue, and the asynchronous service. One benefit of the scalable architecture of Microsoft Dynamics CRM is that the asynchronous service can be hosted on servers other than the Microsoft Dynamics CRM server, resulting in improved performance.

Register plug-ins for asynchronous events when they have to perform lots of processing or for functions that are not time critical. Registering a plug-in that performs lots of processing for a synchronous event can adversely affect the performance of Microsoft Dynamics CRM.

You should stop the asynchronous service before you unregister a plug-in that was registered to execute asynchronously. Stopping the service prevents a situation where an asynchronous registered plug-in has been queued for execution but for which there is no plug-in assembly currently registered. For example, consider the situation in which a plug-in has been registered to execute asynchronously and the related event has fired. After the asynchronous operation has been queued by the queue manager, you then unregister (delete) the plug-in assembly from the Microsoft Dynamics CRM database. In this case, an error occurs when the asynchronous service tries to execute the queued asynchronous operation but the plug-in assembly no longer exists.

Queue Manager

The queue manager creates and manages asynchronous operations that are sent to the asynchronous service either from the event execution pipeline or directly by a Web service call. When an event is raised in the event execution pipeline, and if one or more plug-ins are registered for that event, the queue manager creates a new asynchronous operation in the queue. Throughout the lifetime of the asynchronous operation, its status may change multiple times from creation until it is completed. The queue manager runs as part of the asynchronous service and manages the state changes of the asynchronous operations. A part of the queue manager, known as the asynchronous queue agent, is located on the Microsoft Dynamics CRM server.

AsyncOperation (System Job) Entity

A system job, also known as an asynchronous operation, is used to define and track the execution of an asynchronous operation, for example an asynchronous registered plug-in, workflow, or other background system operation. When dealing with asynchronous plug-ins and workflows, you typically do not directly create an asyncoperation entity record. Instead, an asyncoperation record is created in the database by the platform whenever an asynchronous plug-in or a workflow is to execute, or any one of other asynchronous system operations is to be performed. However, the asyncoperation entity is useful when developing a custom tool to manage or report on asynchronous operations in Microsoft Dynamics CRM.

Note that System Job is the display name of this entity when viewed in Microsoft Dynamics CRM. The asyncoperation logical name is always used when programming with the SDK.

My above blog is based on Microsoft’s Official information.

I hope this blog about ‘Microsoft Dynamics CRM 2011 – Asynchronous Service Architecture’ was informative. Please feel free to leave your comments.

Post a comment or leave a trackback: Trackback URL.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: