Class WebSocketMessageEncoder

java.lang.Object
io.micronaut.http.netty.websocket.WebSocketMessageEncoder

@Requires(classes=WebSocketSessionException.class) @Singleton public class WebSocketMessageEncoder extends Object
Encapsulate functionality to encode WebSocket messages.
Since:
1.0
Author:
sdelamo
  • Constructor Details

    • WebSocketMessageEncoder

      public WebSocketMessageEncoder(MediaTypeCodecRegistry codecRegistry)
      Parameters:
      codecRegistry - The codec registry
  • Method Details

    • encodeMessage

      public io.netty.handler.codec.http.websocketx.WebSocketFrame encodeMessage(Object message, MediaType mediaType)
      Encode the given message with the given media type.
      Parameters:
      message - The message
      mediaType - The media type
      Returns:
      The encoded frame