Hey there :wave: Is there any solution by now to f...
# ktor
m
Hey there 👋 Is there any solution by now to forward certain vert.x requests to Ktor? So that Ktor re-uses vert.x’ HTTP server and handles only certain routes.
b
have ktor routes under different port and proxy vert.x requests to
<http://localhost>:<KTOR_PORT>/<path>
?
m
That’s my backup plan in case there’s no good solution 😅 Sounds nasty, esp. with websockets involved.
b
It IS nasty!
Alternatively you could reuse the same services from both, ktor and vert.x
m
I can only use one HTTP port
r
Why do you need to use both?
m
I have a larger vert.x Java project that is to be migrated to Kotlin + Ktor over time. So migrated code would use Ktor route while old code would use vert.x route.
r
What advantages gives Ktor vs Vert.x with Kotlin?
1
m
We’re familiar with it.
k
Why not migrate to Quarkus?
b
You could just as well ask "why not migrate to micronout". All of them are good in their own way. In the end it boils down to preference and familiarity...
1
👍 1
m
Yup. Back on topic please 😄
r
You could check the sources of
micronaut-ktor
module, which embeds Ktor inside Micronaut, reusing Micronaut's native http server. https://github.com/micronaut-projects/micronaut-kotlin/tree/master/ktor/src/main/kotlin/io/micronaut/ktor
m
That replaces the existing HTTP server with Ktor instead of just adding Ktor as 2nd level
k
Quarkus is vert.x underneath which is why I suggested it...
At any rate, doing a proxy is probably simplest but I'd suggest rewriting the websocket piece...