swagger in undertow
by David Robinson
Is there a way to add Swagger into an undertow based server? Here is how I
start my server now - standard stuff:
------
RoutingHandler rh0 = new RoutingHandler()
.post("/bb/{cohort}/{topictype}", new
UniversalPostHttpHandler(kep, kvemp))
.get("/bb/{cohort}/{topictype}/schema", new UniversalGetHttpHandler())
.get("/admin/healthcheck", new
UniversalHealthCheckHttpHandler())
.get("/admin/metrics", new
UndertowGetMetricHttpHelperHandler())
Undertow server = Undertow.builder().setIoThreads(undertowIoThreads
).addHttpListener(ipPort, ipAddress).setHandler(rh0).build();
------
Ideally, swagger could just be added as another handler of sorts.
I ran across this post, which is over a year old, which is unanswered:
https://stackoverflow.com/questions/54685819/swagger-undertow
Appreciate any advice on how to do this.
Thanks,
4 years, 4 months
Exchange complete listener doesn't fire if exchange is ended
by Brad Wood
I have a basic exchange listener configured for testing that simply logs at
the end of each request something like
exchange.addExchangeCompleteListener((httpServerExchange, nextListener) -> {
if (httpServerExchange.getStatusCode() > 399) {
CONTEXT_LOG.warnf("responded: Status Code %s (%s)",
httpServerExchange.getStatusCode(), fullExchangePath(httpServerExchange));
}
nextListener.proceed();
});
This works great, but if the exchange is ended-- for example using the
response-code handler-- then the exchange complete listener never fires.
Is this working as designed?
Thanks!
~Brad
*Developer Advocate*
*Ortus Solutions, Corp *
E-mail: brad(a)coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com
4 years, 4 months