[Bernstein09] Section 4.9. Summary

来源:百度文库 编辑:神马文学网 时间:2024/06/13 03:37:31
4.9. Summary
QueuedTP is an alternative to direct TP that uses a persistent queue betweenclient and server programs. The client enqueues requests and dequeuesreplies. The server dequeues a request, processes the request, enqueuesa reply, and commits; if the transaction aborts, the request isreplaced in the queue and can be retried.
The main benefits of queued TP are:
A client can submit a request even when the server is down (by enqueuing the request).
A server can reply to the client even when the client is down (by enqueuing the reply).
Communication failures do not result in lost replies or uncertain results.
Balancing the load among multiple servers is easier.
Priority can be given to some requests relative to others.
The cost of these benefits is the additional transactions to enqueue requests and dequeue replies.
Clientscan determine whether or not a request executed by examining itsqueues. An unexecuted request is still in the client’s request queue.An executed request has a reply in the client’s reply queue. If thequeue manager remembers the unique ID of the last request enqueued andreply dequeued by a client, then the client can recover from a failureby synchronizing its state with the state known to the queue manager.To cope with failures that make the result of nonredoable operations(such as printing a check) ambiguous, the client should read the stateof the device and compare it to the state it logged before operating onthe device.
Aqueue manager is needed to support the queued communication model. Itmay be an independent product or an integral component of atransactional middleware product. It provides operations for thestorage abstraction of queues, including:
Operations on queued messages, such as enqueue, dequeue, scan a queue, and keyed access
Creating and destroying queues
Modifying a queue’s attributes (e.g., queue owner, size, queue name, privileges)
Starting and stopping a queue.
Aqueue manager may support routing, either by enqueuing to a remoteserver, or by enqueuing locally and forwarding messages to a remoteserver. This is useful to reroute requests to another server when aprimary server is overloaded or down, or to batch requests that areprocessed only periodically. When forwarding is done transactionally,it adds a fourth transaction to the model.
Publish-subscribeis a messaging style where a publisher sends a message to a broker thatis responsible for forwarding the message to many subscribers.Subscribers register interest in certain message types and receive allpublished messages of that type. Publish-subscribe systems usually arebased on queued messaging, where published messages are distributed tosubscribers via queues.
Othertypes of message-oriented middleware are available to integrateindependent TP applications that support different communicationsprotocols, different application functions, and different messageformats. The two main architectures for performing this reconciliationare broker-based products, often called enterprise applicationintegration (EAI) systems, and bus-based products, often calledenterprise service buses (ESBs). They include functions for bridgingdifferent protocols, routing messages to the desired application, andtranslating between different message formats.