Eclipse Vert.x is a toolkit for building reactive applications on the JVM. It's event driven, non-blocking, lightweight and fast.
Build configuration
The integration with Vert.x is contained in the kvision-server-vertx module. It has to be added as the dependency in the common target. This module depends on the vertx-web, vertx-lang-kotlin, vertx-lang-kotlin-coroutines, jackson-module-kotlin and guice libraries. Any other dependencies can be added to build.gradle.kts and then be used in your application.
The integration module utilizes Guice and you can access external components and resources by injecting object instances into your class. KVision allows you to inject RoutingContext instance, which gives you access to the Vertx instance and also allows you to access the current request and session information.
You can also inject other Guice components, defined in your application and configured in custom Guice modules or with just-in-time bindings.
Note: The new instance of the service class will be created by Guice for every server request. Use session or request objects to store your state with appropriate scope.
Blocking code
Since Vert.x architecture is asynchronous and non-blocking, you should never block a thread in your application code. If you have to use some blocking code (e.g. blocking I/O, JDBC) always use the dedicated coroutine dispatcher.
Vert.x services are deployed as "verticles". Main verticle is the application starting point. It's used to initialize and configure the application. Minimal implementation for KVision integration contains kvisionInit and applyRoutes function calls.
If you are using websockets, you need to use a special version of kvisionInit function, and pass a HttpServer instance and a list of all services declaring websocket channel connections.
You can use standard Vert.x configuration to add authentication and authorization to your application. You can use serviceRoute extension function to apply your AuthHandler to the selected KVision services.