• No results found

Message acceptance

In document DISTRIBUTED HANDLER ARCHITECTURE (Page 108-111)

CHAPTER 5 DISTRIBUTED HANDLER ARCHITECTURE EXECUTION

5.2 Execution

5.2.2 Message acceptance

In DHArch, the second stop of a message is the acceptance. Typically, a message arrives within a context, specifically Web Service container context. The context consists of additional information for the execution as well as the message. It also conveys supplementary information about the service requester. Therefore, the context object is stored not to lose the necessary information while the execution happens. By using this record, the response to the right client is guaranteed even if many requests are received from many clients.

DHArch stores interacting platform specific context objects without changing the format. This is necessary for the flexibility. DHArch cooperates with the various Web Service containers. Since every container makes use of its own context object for the internal execution, creating a common format for the contexts requires deep knowledge about each one of them. Moreover, conversion between the context objects and DHArch specific common format would be costly. Hence, we decided to keep them as they are. This is reasonable because the interacting container context objects are kept so that the native container can continue its execution after DHArch completes its own.

For the storage, a queue, Container Message Context Queue (CMCQueue), is utilized to save the interacting container contexts. The queue is extendable when it is necessary. Any kind of object is able to be stored without concerning its type. The object is mapped with a unique UUID generated key given to a message when it has arrived.

DHArch creates its unique message context, Distributed Handler Message Context (DHMContext), to perform its internal execution properly. A context object keeps the necessary information about a message. The container contexts are not utilized

92

for this purpose because of the reason we explained above; we want to build an architecture having a container independent execution. Otherwise, we need to revise the execution mechanism for newly introduced containers.

DHMContexts are also stored in a queue, Incoming Message Queue (IMQueue). Utilizing queues let DHArch accept every arriving message. Otherwise, the messages would have to wait to be accepted or need to be dropped when the message rate is too high. Instead, we choose to accept and offer them the service in an orderly fashion. Similar to CMCQueue, IMQueue identifies DHMContext with the unique identifier.

DHMContext employs several structures and parameters to contribute the execution. The most important one is the handler orchestration structure. It defines the sequence of the handlers. A sequence consists of stages and their corresponding handlers. Moreover, DHMContext contains the message too. The message can be updated while the execution continues. Additionally, several supplementary parameters are kept within the context to facilitate the execution.

An orchestration structure is very important to have an efficient and accurate execution. This structure is generated for every incoming message. The detailed information about the orchestration can be found in CHAPTER 4. DHArch utilizes an orchestration mechanism that separates description from the execution. A basic orchestration descriptive constructs are utilized to address very complex configurations. The engine simplifies this complex orchestration configuration during the execution to reduce the complexity of the management. This allows having easily manageable and very effective execution environment for the distributed handlers.

93 Handler A Handler B Start End

Start Handler A Handler B End

Stage I Stage II

Stage I

Figure 5-2: Sequential and parallel executions for Handler A and Handler B

All basic orchestration constructs are mapped to two simpler processing styles, sequential and parallel. The important question is how sequential and parallel execution happens. Stages are introduced to support parallel execution. Many stages can be employed in an orchestration structure and their executions are sequential among each other. However, the handlers in a stage are executed concurrently. Each stage should contain at least one handler and there must be more than one handler in a stage to have a parallel execution. Figure 5-2 depicts sequential and parallel executions. If the handlers are in the separate stages, they are executed sequential otherwise they have to be processed concurrently.

The message processing happens based on the guidance of the orchestration structure. Although it is initially loaded from HODocument, the orchestration is not static. It can be modified during the execution if the orchestration policy allows it. The policy contains the laws about must and mustn’t. A handler orchestration structure may contain several conditions for the correct execution. The policy may dictate the execution sequence. For example, an encryption handler is forced to be executed first. Hence, the

94

conditions have to be followed while the modification of the orchestration structure is happening.

Queues work as regulators when the large number of requests arrives. Accepting the requests arriving to the Web Service and processing them during the appropriate time increase the system responsiveness; in a service/client interaction, a service sometimes does not get a message while it sometimes receives too many messages to handle.

When DHMContext is generated and its insertion to IMQueue is completed, the acceptance of the message is finalized. At this moment, the cooperating container context is safe in CMCQueue and DHMContext objects waiting to be selected for their executions are ready in IMQueue.

In document DISTRIBUTED HANDLER ARCHITECTURE (Page 108-111)