Skip to content

Instantly share code, notes, and snippets.

@rimms
Last active August 29, 2015 14:15
Show Gist options
  • Save rimms/c30548fa60113474633d to your computer and use it in GitHub Desktop.
Save rimms/c30548fa60113474633d to your computer and use it in GitHub Desktop.
Exception policy of JubaProxy

Exception policy of JubaProxy

Policy

  • 通信先の Server のいずれかから例外(アプリケーション例外、通信レイヤの例外)が返却された場合は、Client へ例外を返却する。
  • Client に返却する例外は、通信先から返却された例外のうち、最もはじめに発生した例外を返却する。
    • ただし、以下のような通信レイヤの例外は、ユーザー(Client)がハンドリングする可能性が高いので、発生した場合にはアプリケーション例外よりも優先的に返却する。
      • リクエストタイムアウト
      • 接続失敗
      • Server からの接続破棄

Cases

Case-01: OK * 3

Client ----> Proxy --+-- OK --> Server1
                     |
                     +-- OK --> Server2
                     |
                     +-- OK --> Server3

 * OK: Success
  • Proxy returns aggregated value to Client

Case-02: OK *2 & Transport Layer Exception * 1

Client ----> Proxy --+-- OK --> Server1
                     |
                     +-- TE --> Server2
                     |
                     +-- OK --> Server3

 * OK: Success
 * TE: Transport Layer Exception (e.g. Request Timeout)
  • Proxy raises Transport Layer Exception to Client

Case-03: OK *2 & Application Layer Exception * 1

Client ----> Proxy --+-- OK --> Server1
                     |
                     +-- AE --> Server2
                     |
                     +-- OK --> Server3

 * OK: Success
 * AE: Application Layer Exception (e.g. RPC parameter is the out of range)
  • Proxy raises Application Layer Exception to Client

Case-04: OK * 1 & Transport Layer Exception * 1 & Application Layer Exception * 1

Client ----> Proxy --+-- OK --> Server1
                     |
                     +-- AE --> Server2
                     |
                     +-- TE --> Server3

 * OK: Success
 * AE: Application Layer Exception (e.g. RPC parameter is the out of range)
 * TE: Transport Layer Exception (e.g. Request Timeout)
  • Proxy raises Transport Layer Exception to Client

Case-05: OK * 1 & Transport Layer Exception * 2

Client ----> Proxy --+-- OK  --> Server1
                     |
                     +-- TE1 --> Server2
                     |
                     +-- TE2 --> Server3

 * OK : Success
 * TE1: Transport Layer Exception (Request Timeout)
 * TE2: Transport Layer Exception (Connection Error)
  • Proxy raises Transport Layer Exception to Client
  • If TE2 raised after TE1, Proxy raise TE1.

Case-06: OK * 1 & Application Layer Exception * 2

Client ----> Proxy --+-- OK  --> Server1
                     |
                     +-- AE1 --> Server2
                     |
                     +-- AE2 --> Server3

 * OK : Success
 * AE1: Application Layer Exception (RPC parameter is the out of range)
 * AE2: Application Layer Exception (specified id is not found)
  • Proxy raises Application Layer Exception to Client
  • If AE2 raised after AE1, Proxy raise AE1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment