Here you will find examples demonstrating Vert.x core in OSGi.
Vert.x core is packaged as an OSGi bundle that can be deployed in OSGi frameworks R4.2+. However, it requires Jackson and Netty to be deployed. Check the Vert.x core manual for further details.
A Bundle Activator
exposing the Vert.x instance and the event bus as OSGi service.
An Apache Felix iPOJO component consuming the vertx
service to create a HTTP server.
Verticles can be exposed as a service and consumed using a white-board pattern. Here is an example
An example using the vert.x JDBC client is available in link:src/main/java/io/vertx/example/osgi/jdbc. Notice that depending on the connection pool implementation, you may have to put the JDBC driver in your classpath. This is the case if you use the default connection pool using C3P0. In this example, we use HikariCP.
Here is the list of the bundles to deploy this example:
[13] - io.vertx.core - 3.9.0
[14] - io.netty.common - 4.1.1.Final
[15] - io.netty.buffer - 4.1.1.Final
[16] - io.netty.transport - 4.1.1.Final
[17] - io.netty.handler - 4.1.1.Final
[18] - io.netty.codec - 4.1.1.Final
[19] - io.netty.handler-proxy - 4.1.1.Final
[20] - io.netty.codec-socks - 4.1.1.Final
[21] - io.netty.codec-http - 4.1.1.Final
[22] - io.netty.codec-http2 - 4.1.1.Final
[23] - io.netty.codec-dns - 4.1.1.Final
[24] - io.netty.resolver - 4.1.1.Final
[25] - io.netty.resolver-dns - 4.1.1.Final
[26] - com.fasterxml.jackson.core.jackson-core - 2.7.4
[27] - com.fasterxml.jackson.core.jackson-databind - 2.7.4
[28] - com.fasterxml.jackson.core.jackson-annotations - 2.7.0
[29] - vertx-web - 3.9.0
[30] - vertx-auth-common - 3.9.0
[31] - vertx-jdbc-client - 3.9.0
[32] - vertx-sql-common - 3.9.0
[33] - com.zaxxer.HikariCP - 2.4.6
[34] - org.hsqldb.hsqldb - 2.3.4
[35] - org.apache.felix.ipojo - 1.12.1
[36] - org.apache.commons.io - 2.5.0
[37] - io.vertx.osgi-examples - 3.9.0 <--- current project
You can find another example of vert.x application in the OSGi context on http://paulbakker.io/osgi/vertx-osgi/ (the code is on https://github.com/paulbakker/osgi-vertx-demo).