Correctly shutting down a websocket handler
by Robin Anil
When a client disconnects, I see that onClose is not being fired. The only
way this seems to be firing if client sents a close frame.
Is there any way to detect disconnection and immediately close all the
opened resources.
Robin
Robin Anil | Software Engineer
1 year, 2 months
two questions
by Pere Ferrera
Hi there,
I have two questions: 1) How can I configure the underlying socket
parameter SO_LINGER using the Undertow API ? and 2) Is there something that
I can use to rate-limit requests issued to an Undertow server ? (something
similar to the DoS Filter in Jetty)
Thanks,
7 years, 11 months
start listener on random port
by Sascha Sadat-Guscheh
hello undertow developers!
is there a way to start a http listener on a random free port? i have a test suite that runs multithreaded so each untertow server uses a random port, that i get like this:
new ServerSocket(0).getLocalPort()
sometimes i run into a race condition when a different process grabs the port before undertow listens on it. so a possible solution would be to just let undertow assign the port, and then ask it what port its listening on. (or pass the socket instead of the port number to undertow)
is that a worthwile feature? should i try to submit a pr that does that? or is it already possible?
thanks!
7 years, 11 months
dispatch and isDispatched do not agree
by Oliver Dain
I've got some pretty simple code that looks something like:
if (!exhange.isDispatched()) {
exchange.dispatch(() -> {
assert exchange.isDispatched();
// more stuff....
});
}
but the assert fails. That is, when dispatch calls my runnable isDispatched
is not true.
I believe I have a bug somewhere with how/when dispatches are happening so
I've littered my code with such asserts and they fail reliably even when
I'm quite sure the exchange has been dispatched (e.g. when it is literally
the first call in a Runnable passed to to the dispatch() method).
What am I doing wrong?
--
CTO, Analytic Spot
44 West Broadway #222
Eugene, OR 97401
analyticspot.com • 425-296-6556
www.linkedin.com/in/oliverdain
8 years
is there a server option for max http line length?
by Michael Grove
I found `UndertowOptions.MAX_HEADER_SIZE` which seemed to roughly
correspond to this, but from what I could see in the HTTP listener,
connections are severed if they exceed the length rather than sending a 414.
Is there a different option I should be using?
Thanks.
Mike
8 years
Is there a hook for before sending data to the client?
by Bill O'Neil
Hello,
I'm trying to make a handler that manages a request scoped sql transaction.
Ideally it would be a middleware handler that opens the connection and
starts the transaction and after the chain of handlers is finished it will
commit the transaction. The issue I am facing is the browser can receive
the data before the transaction is committed since the data is sent further
down the chain.
Is there some type of hook where I can commit / close the transaction
before any data is sent? This should work fine in a blocking handler but an
asynchronous one may have issues?
My other thought is to make a Handler that expects some object to be
returned. In this handler commit / close the connection as soon as the
object is returned then send the data to the browser after. Would this be
my best option?
Thanks,
Bill
8 years
Request/Response wrappers on HttpServerExchange not cleared ?
by Kim Rasmussen
Hi,
I am working on a reverse proxy using undertow, and I have just added
debugging support, where I can add a request/response wrapper to the
exchange and save/trace/debug the result.
I noticed that for persistent connections, those wrappers seem to be kept
on the exchange when subsequent requests arrive - even after endExchange()
has been called on the first request.
Can that be true ? Is there something I need to do to cleanup when the
exchange ends ? or should they have been removed in closeAndFlushResponse()
?
--
Med venlig hilsen / Best regards
*Kim Rasmussen*
Partner, IT Architect
*Asseco Denmark A/S*
Kronprinsessegade 54
DK-1306 Copenhagen K
Mobile: +45 26 16 40 23
Ph.: +45 33 36 46 60
Fax: +45 33 36 46 61
8 years
GRPC on Undertow
by Steve Hu
Hi,
The current GRPC Java is implemented on Netty and I am wondering if you are
interested in implementing another version on Undertow. It would be very
nice so that I can have both REST and GRPC running on Undertow. GRPC is the
future of microservices architecture.
https://github.com/grpc/grpc-java
I have a REST microservices framework built on top of Undertow and planning
to start a GRPC framework.
https://github.com/networknt/light-java
Thanks,
Steve
8 years
Undertow Read TimeOut Response
by Вячеслав А
In our project we use Undertow in WildFly application server.
Also we set Read Time Out limits for Undertow.
As we can understand, Read Time Out managed by
ReadTimeoutStreamSourceConduit class.
At Read Time Out moment will be called IoUtils.safeClose and resources will
be closed.
But we want to return message with TimeOut code (
StatusCodes.REQUEST_TIME_OUT ).
How can we properly close Exchange and return code to client as response?
I tried to handle in exchange.getConnection().addCloseListener , but i cant
find a way to return code.
Also, i found Test
/undertow-core/src/test/java/io/undertow/server/ReadTimeoutTestCase.java,
but it doesnt work.
8 years