public class CamelWebSocketHandler extends Object implements io.undertow.server.HttpHandler
HttpHandler
that delegates to WebSocketProtocolHandshakeHandler
and provides some wiring to
connect UndertowConsumer
with UndertowProducer
.Constructor and Description |
---|
CamelWebSocketHandler() |
Modifier and Type | Method and Description |
---|---|
void |
handleRequest(io.undertow.server.HttpServerExchange exchange) |
boolean |
send(Predicate<io.undertow.websockets.core.WebSocketChannel> peerFilter,
Object message,
int timeout,
org.apache.camel.Exchange camelExchange,
org.apache.camel.AsyncCallback camelCallback)
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 . |
void |
setConsumer(UndertowConsumer consumer) |
public void handleRequest(io.undertow.server.HttpServerExchange exchange) throws Exception
handleRequest
in interface io.undertow.server.HttpHandler
Exception
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
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
.peerFilter
- a Predicate
to apply to the set of peers obtained via delegate
's
WebSocketProtocolHandshakeHandler.getPeerConnections()
message
- the message to sendcamelExchange
- to notify about the outcomecamelCallback
- to notify about the outcometimeout
- in millisecondstrue
if the execution finished synchronously or false
otherwiseIOException
public void setConsumer(UndertowConsumer consumer)
consumer
- the UndertowConsumer
to setApache Camel