4 ArchitectureRPC
Ralph Schaer edited this page 2026-10-30 16:08:52 +01:00

RPC Architecture

The dealer side of wamp2spring handles registration and invocation flow for RPC.

In the current codebase this includes:

  • procedure registration from WAMP clients
  • server-side procedures through @WampProcedure
  • dealer-managed routing in a single shared scope
  • progressive call results
  • cancellation handling
  • timeout enforcement
  • caller identification and related advanced options
  • registration-related meta features and revocation support

Application methods are discovered from Spring beans and mapped either to the explicit annotation value or to the default beanName.methodName procedure name.

flowchart TD
    Call[CALL on clientInboundChannel] --> Validate[Validate URI, authorize, check options]
    Validate --> Lookup{Annotated procedure exists?}
    Lookup -->|Yes| Method[HandlerMethodService invokes Java method]
    Method --> Result[Map return value or exception to RESULT or ERROR]
    Lookup -->|No| Registry[ProcedureRegistry selects registered callee]
    Registry --> Invocation[INVOCATION through clientOutboundChannel]
    Invocation --> Callee[Remote callee]
    Callee --> Reply[YIELD or ERROR through clientInboundChannel]
    Reply --> Pending[Resolve pending call and update timer]
    Pending --> Result
    Result --> Caller[clientOutboundChannel to caller]

The client registry owns matching, shared/sharded selection, and pending invocation state. RpcMessageHandler handles timeout tasks, cancellation, rerouting, and lifecycle events. Annotated Java procedures use a separate lookup map and synchronous invocation path, so they are not enumerated by registration meta APIs and do not inherit remote-call timeout/cancellation behavior.

See RPC for binding, results, errors, negotiation, and revocation; MetaAPIs for router inspection; and Events for lifecycle hooks.