Spring WebFlux WebSocket

Reactive WebSocket support for full-duplex, bidirectional communication in WebFlux applications. Provides WebSocketHandler, WebSocketSession, and integration with STOMP messaging protocol.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/spring-webflux-websocket"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

AsyncAPI Specification

webflux-websocket-asyncapi.yml Raw ↑
asyncapi: 3.0.0
info:
  title: Spring WebFlux WebSocket API
  version: 6.2.0
  description: >-
    AsyncAPI specification describing WebSocket communication patterns for
    Spring WebFlux applications. Spring WebFlux provides reactive WebSocket
    support via WebSocketHandler and WebSocketSession, enabling full-duplex,
    bidirectional messaging between clients and servers.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  externalDocs:
    url: https://docs.spring.io/spring-framework/reference/web/webflux-websocket.html
    description: Spring WebFlux WebSocket Documentation

servers:
  production:
    host: '{host}:{port}'
    protocol: ws
    description: Spring WebFlux WebSocket endpoint
    variables:
      host:
        default: localhost
        description: Application host
      port:
        default: '8080'
        description: Application port
  secure:
    host: '{host}:{port}'
    protocol: wss
    description: Secure Spring WebFlux WebSocket endpoint (TLS)
    variables:
      host:
        default: localhost
        description: Application host
      port:
        default: '8443'
        description: Application port

channels:
  websocketSession:
    address: /ws
    description: >-
      WebSocket channel mapped via Spring WebFlux WebSocketHandlerAdapter.
      A WebSocketSession is established on connection and provides reactive
      inbound() and outbound() message streams.
    messages:
      textMessage:
        $ref: '#/components/messages/TextMessage'
      binaryMessage:
        $ref: '#/components/messages/BinaryMessage'
      pingMessage:
        $ref: '#/components/messages/PingMessage'
      pongMessage:
        $ref: '#/components/messages/PongMessage'
      closeMessage:
        $ref: '#/components/messages/CloseMessage'

  stompBroker:
    address: /stomp
    description: >-
      STOMP over WebSocket channel. Spring WebFlux integrates with STOMP messaging
      protocol for topic subscriptions, queued messages, and message broker relay.
    messages:
      stompMessage:
        $ref: '#/components/messages/StompMessage'

operations:
  sendTextMessage:
    action: send
    channel:
      $ref: '#/channels/websocketSession'
    summary: Send Text Message
    description: >-
      Client sends a text message over the WebSocket connection.
      In Spring WebFlux, this corresponds to WebSocketSession.send(publisher).
    messages:
      - $ref: '#/components/messages/TextMessage'

  receiveTextMessage:
    action: receive
    channel:
      $ref: '#/channels/websocketSession'
    summary: Receive Text Message
    description: >-
      Server receives a text message from the client.
      In Spring WebFlux, WebSocketSession.receive() returns a Flux<WebSocketMessage>.
    messages:
      - $ref: '#/components/messages/TextMessage'

  sendBinaryMessage:
    action: send
    channel:
      $ref: '#/channels/websocketSession'
    summary: Send Binary Message
    description: Send a binary data frame over the WebSocket connection.
    messages:
      - $ref: '#/components/messages/BinaryMessage'

  receiveBinaryMessage:
    action: receive
    channel:
      $ref: '#/channels/websocketSession'
    summary: Receive Binary Message
    description: Receive a binary data frame from the WebSocket connection.
    messages:
      - $ref: '#/components/messages/BinaryMessage'

  subscribeToTopic:
    action: send
    channel:
      $ref: '#/channels/stompBroker'
    summary: Subscribe to Topic
    description: STOMP SUBSCRIBE frame to subscribe to a topic or queue.
    messages:
      - $ref: '#/components/messages/StompMessage'

  receiveTopicMessage:
    action: receive
    channel:
      $ref: '#/channels/stompBroker'
    summary: Receive Topic Message
    description: Receive a STOMP MESSAGE frame from a subscribed topic.
    messages:
      - $ref: '#/components/messages/StompMessage'

components:
  messages:
    TextMessage:
      name: TextMessage
      title: WebSocket Text Message
      summary: A UTF-8 encoded text data frame (opcode 0x1)
      contentType: text/plain
      payload:
        $ref: '#/components/schemas/TextPayload'

    BinaryMessage:
      name: BinaryMessage
      title: WebSocket Binary Message
      summary: A binary data frame (opcode 0x2)
      contentType: application/octet-stream
      payload:
        $ref: '#/components/schemas/BinaryPayload'

    PingMessage:
      name: PingMessage
      title: WebSocket Ping Frame
      summary: A control ping frame (opcode 0x9) for keep-alive
      payload:
        $ref: '#/components/schemas/ControlPayload'

    PongMessage:
      name: PongMessage
      title: WebSocket Pong Frame
      summary: A control pong frame (opcode 0xA) in response to ping
      payload:
        $ref: '#/components/schemas/ControlPayload'

    CloseMessage:
      name: CloseMessage
      title: WebSocket Close Frame
      summary: A control close frame (opcode 0x8) to initiate connection closure
      payload:
        $ref: '#/components/schemas/ClosePayload'

    StompMessage:
      name: StompMessage
      title: STOMP Frame
      summary: A STOMP protocol frame for topic messaging over WebSocket
      contentType: application/json
      payload:
        $ref: '#/components/schemas/StompPayload'

  schemas:
    TextPayload:
      type: object
      properties:
        content:
          type: string
          description: UTF-8 text content of the message
        sessionId:
          type: string
          description: WebSocketSession identifier

    BinaryPayload:
      type: object
      properties:
        data:
          type: string
          format: binary
          description: Binary data content

    ControlPayload:
      type: object
      properties:
        applicationData:
          type: string
          description: Optional application data in control frame

    ClosePayload:
      type: object
      properties:
        statusCode:
          type: integer
          description: RFC 6455 close status code (e.g. 1000 Normal Closure)
        reason:
          type: string
          description: Human-readable reason for closure

    StompPayload:
      type: object
      properties:
        command:
          type: string
          enum: [CONNECT, CONNECTED, SUBSCRIBE, UNSUBSCRIBE, SEND, MESSAGE, ACK, NACK, DISCONNECT, ERROR]
          description: STOMP command
        headers:
          type: object
          additionalProperties:
            type: string
          description: STOMP frame headers
        body:
          type: string
          description: STOMP frame body