Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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, it this architecture should work with Netty server/ other. 

...

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 Message Handler interface and will be responsible for its task.  Gliffy DiagramnameHandler

 

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. Set metdata in 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 to pdxtopdx
  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 generate AuthFailed exceptiongenerateAuthFailedexception

 

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 the apitheapi); if there is no error then call Request.ApiInvoker() for a synchronous request or call Request.AsyncApiInvoker for async Request

 

Class Hierarchy

 

Gliffy Diagram
nameHandler

 

Handler

Context

Message

Request

Response

Exception

SyncApiInvoker

AsyncApiInvoker

ResponseSender

Connection