[undertow-dev] How to feed data to websockets from an external source

Mátyás Bene notabenem at hotmail.com
Wed Apr 10 02:49:37 EDT 2019


Hi all,

I would appreciate any kind of guidance and information about how to use undertow in a scenario where we'd like to poll an external source for messages (e.g. kafka) and feed those messages to all the connected websocket sessions.

So far the only examples I've found were about mirroring the messages received from http/websockets back to other websocket sessions or write those messages to Kafka. What we'd ideally need is READ from kafka (e.g. using a dedicated thread, busy-spinning and polling) and pass the retrieved data to undertow (ideally within the JVM without going through HTTP / REST) that would then send them over websockets to the connected clients.

A separate, but related question is, assuming that we were to use the websocket-JSR interface, that is it safe to assume that undertow ensures that at any given time only a single thread is writing to a specific websocket session, especially when using the asyncremote.send() method? Would undertow be able to paralellize all the async send operations using multiple threads to speed up sending?


M.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20190410/06623d3a/attachment.html 


More information about the undertow-dev mailing list