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

wamp2spring

wamp2spring is a Java implementation of the WAMP v2 specification built on top of Spring Framework 7 and Spring Boot 4.

WAMP is a WebSocket subprotocol that combines two messaging styles in one protocol:

  • Remote Procedure Calls through the dealer role
  • Publish/Subscribe messaging through the broker role

This wiki documents source revision 58fe0dd, version 4.0.2-SNAPSHOT, reviewed on October 30, 2026. Dependency examples use the 4.0.1 release tag; see Maven for building the current snapshot locally.

Connections, registrations, subscriptions, and meta APIs share one routing scope. The realm sent in HELLO does not provide tenant isolation.

What the current project contains

The repository is split into focused modules:

  • wamp2spring-core: core message model, routing, annotations, publisher API, authorization SPI
  • wamp2spring-servlet: servlet/WebSocket integration for Spring MVC
  • wamp2spring-reactive: reactive/WebSocket integration for Spring WebFlux
  • wamp2spring-security-core: shared Spring Security integration pieces
  • wamp2spring-security-servlet: servlet-specific security support
  • wamp2spring-security-reactive: reactive-specific security support
  • wamp2spring-session-servlet: Spring Session integration for servlet deployments

Highlights in the current line

  • Spring Framework 7 and Spring Boot 4 support
  • Java 17 baseline
  • A single shared routing scope for connections, subscriptions, registrations, and meta APIs
  • WAMP authentication hooks with built-in providers for Ticket, WAMP-CRA, SCRAM, and dynamic authentication
  • Spring Security authorization support for WAMP message flows
  • Spring bean annotations for procedures and listeners: @WampProcedure and @WampListener
  • WampPublisher bean for server-side event publication
  • WebSocket serializers for JSON, MessagePack, CBOR, and Smile
  • Servlet long-poll transport in addition to WebSocket
  • Advanced profile support including timeout handling, cancellation, progressive results, publisher/subscriber filtering, and pattern matching

Start here

  • Quickstart for the smallest working application
  • Maven for dependency coordinates and module selection
  • Modules for a module-by-module overview
  • Features for protocol capabilities and toggles
  • Configuration for endpoint paths, channels, and extension points
  • RPC for procedure arguments, results, errors, and advanced routing
  • PubSub for listeners, publisher options, retention, and history
  • MetaAPIs for session, registration, subscription, testament, and reflection procedures
  • Security for Spring Security integration
  • Authentication for WAMP authentication and transport principals
  • Transports for WebSocket, long-poll, and serializer support
  • Sessions for Spring Session integration
  • Events for Spring application lifecycle events
  • Development for building and testing the source

Example applications

Example applications live in the separate wamp2spring-demo repository.

Implementation boundaries

Routing and the default event store live in the application process. Spring Session integration does not distribute WAMP subscriptions or registrations. Annotated Java procedures execute synchronously; the reactive module supplies a WebFlux transport, not automatic Mono/Flux return-value adaptation. See RPC and PubSub for the precise behavior of each application API.