Class CamelWebSocketHandler

  • All Implemented Interfaces:
    io.undertow.server.HttpHandler

    public class CamelWebSocketHandler
    extends Object
    implements io.undertow.server.HttpHandler
    An HttpHandler that delegates to WebSocketProtocolHandshakeHandler and provides some wiring to connect UndertowConsumer with UndertowProducer.
    • Constructor Detail

      • CamelWebSocketHandler

        public CamelWebSocketHandler()
    • Method Detail

      • handleRequest

        public void handleRequest​(io.undertow.server.HttpServerExchange exchange)
                           throws Exception
        Specified by:
        handleRequest in interface io.undertow.server.HttpHandler
        Throws:
        Exception
      • send

        public boolean send​(Predicate<io.undertow.websockets.core.WebSocketChannel> peerFilter,
                            Object message,
                            int timeout,
                            org.apache.camel.Exchange camelExchange,
                            org.apache.camel.AsyncCallback camelCallback)
                     throws IOException
        Send the given message to one or more channels selected using the given peerFilter within the given timeout and report the outcome to the given camelExchange and camelCallback.
        Parameters:
        peerFilter - a Predicate to apply to the set of peers obtained via delegate's WebSocketProtocolHandshakeHandler.getPeerConnections()
        message - the message to send
        camelExchange - to notify about the outcome
        camelCallback - to notify about the outcome
        timeout - in milliseconds
        Returns:
        true if the execution finished synchronously or false otherwise
        Throws:
        IOException