

Javalin 1.2.0 - Custom jetty handlers - Javalin: Simple REST APIs for Java and K...
source link: https://javalin.io/news/2017/12/02/javalin-1.2.0-released.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Javalin 1.2.0 released
Custom jetty handlers
Javalin 1.2.0 introduces the possibility of adding custom jetty handlers, such as StatisticsHandler
and RequestLogHandler
.
You can configure your embedded jetty-server with a handler-chain
(example),
and Javalin will attach it’s own handlers to the end of this chain.
- Kotlin
val statisticsHandler = StatisticsHandler()
Javalin.create().apply {
embeddedServer(EmbeddedJettyFactory({
Server(queuedThreadPool).apply {
handler = statisticsHandler
}
}))
}.start();
Doing this will allow you to integrate Javalin with for example prometheus easily,
by exposing statistics collected by the StatisticsHandler
.
There’s even a tutorial to show you how that’s done: /tutorials/prometheus-example
EventManager cleanup
There was a bug in the Event
data class, where properties were declared as var
instead of val
.
The Javalin
val was nullable for no apparent reason, so that’s been fixed too.
Kotlin 1.2.0
Kotlin has been bumped to 1.2.0
Recommend
-
257
Javalin 0.5.1 released WebSockets (Sep 22, 2017) What's Javalin? Javalin is a very lightweight Java and Kotlin web framework which focuses on simplicity and Java/Kotlin interoperabi...
-
223
A lightweight Java and Kotlin web framework Well... the bad news is that the page you requested isn't he...
-
144
Introducing Javalin Javalin is a very lightweight web framework for Kotlin and Java, inspired by Sparkjava and
-
180
Javalin - A simple web framework for Java and Kotlin Javalin is a very lightweight web framework for Kotlin and Java which supports WebSockets, HTTP2 and async requests. Javalin’s main goals are simplicity, a great developer experience, a...
-
135
A lightweight Java and Kotlin web framework Javalin 1.1.0 released GZIP, CORS and WebSocket improvements (Nov 18, 2017) What's J...
-
6
DRY with Custom Decorated Command Handlers – The Blog of Colin MackaySkip to content You may wish to add similar f...
-
6
# How to create custom handlers for Azure Functions
-
6
Write and configure custom sensu handlers Oct 27, 2017 Sensu is a decent monitoring platform compared to nagios, since the configuration is more flexible (and a lot more config mgmt friendly) and the platform is also eas...
-
5
Running Custom Tasks in jBPM with work item handlersIntroductionYou can use a WorkItemHandler to run custom tasks during the execution of a process in jBPM. In this article, you will run through the steps to create a custom task...
-
6
August 9, 2022 Fun With Custom Interpolated String Handlers ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK