You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

 

Its in progress right now ....

Approach

We will have layered approach for handling the client request message and server response message. Each layer will do its work and pass the message to next layer. Currently,  we are planning to add this with Geode server, but eventually, this architecture should work with Netty server/ other. 

 

Layering

Multiple layers will process the Client request message. The following table contains the handlers for processing request, handler to execute the api,  and handlers to send a response back to the client. Each handler will implement the Handler interface and will be responsible for its task. 

Request Message (Down)DescriptionResponse Message (up)Description
MessageBytesCollector

Collect Message bytes

  1. read message header, find payload size
  2. read payload
  3. pass byte buffer to next handler
MessageSenderSend the message to the client
MetadataCollector
  1. Extract metadata from byte buffer
  2. Setmetdatain context
  3. pass byte buffer to next handler
  
MessageDecoder

Construct Message.

  1. Look apiId and decode message
  2. create Request, ApiInvoker
  3. And pass to next handler
ResponseEncoderSerialize the response if there is no Exception
DecorateKeyValue

Update key value based on metadata

  1. if metadata indicates it is JSON string then
    convert that topdx
  2. pass to next handler

 

ResponseMetadataHandleradd any metadata in response
  DecorateKeyValueDecorate key value based on metadata
  ExceptionHandlerif Exception is set in context, then generate Exception Message
AuthenticateHandler
  1. verify whether connection is authenticated or not
  2. if fail then generate AuthRequired error
ResponseAuthorizationHandler

authorize response

  1. if fail then set generateAuthFailedexception

 

RequestAuthorizationHandler

1. Request object will generate AuthContext

2. And Call authCallback

3. if fail then generate AuthFailed error

StatsHandlerUpdate the stats based on response or error code
StatsHandlerUpdate the geode stats for requestResponseHandlerConstruct Response Message from request
ApiExecutionHandler (execute theapi); if there is no error then call Request.ApiInvoker() for a synchronous request or call Request.AsyncApiInvoker for async Request

 

Class Hierarchy

 

Handler

 

Handler

Context

Message

Request

Response

Exception

SyncApiInvoker

AsyncApiInvoker

ResponseSender

Connection

 

  • No labels