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

      @Deprecated(forRemoval=true, since="4.7") public WebSocketMessageEncoder(MediaTypeCodecRegistry codecRegistry)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Not used anymore
      Parameters:
      codecRegistry - The codec registry
    • WebSocketMessageEncoder

      @Inject public WebSocketMessageEncoder(MediaTypeCodecRegistry codecRegistry, MessageBodyHandlerRegistry messageBodyHandlerRegistry)
      Parameters:
      codecRegistry - The codec registry
      messageBodyHandlerRegistry - The message body handler 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