Database Reference
In-Depth Information
Cluster messaging
As mentioned earlier, one of the many benefits of using NSB is that you can distribute the
load or the NSB services or processes. This is commonly known as scaling out the services.
The idea is that you can copy a service, say an order handler, and copy the exact code or
DLL to be a worker to distribute the work. The worker will be exactly the same as the or-
der handler, except for its configuration. The configuration of the original order handler
would normally be labeled as the master , and the subsequent extra workers will be labeled
as worker processes. The worker processes could be running locally, but that wouldn't be
helpful if the local server is overtaxed with work already, or they could be framed out to
other servers that have process speed to spare.
This model is a form of round-robin clustering, where a handler can distribute its workload
to additional workers doing exactly the same kind of work. A distributor is used with
MSMQ. If an endpoint has a critical time set for performance and requires more processing
help, this clustering could be used to spawn off work to the same services that live on other
machines to share the load. If the machine processing the message crashes, the message
would be rolled back to the queue and other machines could then process it accordingly.
Worker services send messages through a control queue saying that they are ready for
work. The distributor stores these messages, and when it receives the messages, it farms
them out of the available queues. All the pending work stays in the distributor's queue so
that messages can be timed for performance.
In this section, we will be using the ScaleOut solution with the following projects:
Orders.Messages : This refers to the common messages for the sender and
handlers.
Orders.Sender : This will send messages to Orders.Handler to be handled
across the workers, worker1 and worker2 .
Orders.Handler.Worker1 : This is one of the worker services that uses a
worker profile to send a response back to the sender. This will be an additional
worker copy of Orders.Handler .
Orders.Handler.Worker2 : This is one of the worker services that uses a
worker profile to send a response back to the sender. This will be an additional
worker copy of Orders.Handler .
Orders.Handler : This is an endpoint that processes the message and config-
ures it to the distributor. This will be the master profile that the sender will send the
Search WWH ::




Custom Search