Skip to content

Latest commit

 

History

History
65 lines (48 loc) · 2.57 KB

README.adoc

File metadata and controls

65 lines (48 loc) · 2.57 KB

Vert.x OSGi examples

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.

Vertx Activator

A Bundle Activator exposing the Vert.x instance and the event bus as OSGi service.

Using Vert.x as a service

An Apache Felix iPOJO component consuming the vertx service to create a HTTP server.

Exposing Verticles as services

Verticles can be exposed as a service and consumed using a white-board pattern. Here is an example

JDBC

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.3.2
[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.3.2
[30] - vertx-auth-common - 3.3.2
[31] - vertx-jdbc-client - 3.3.2
[32] - vertx-sql-common - 3.3.2
[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.3.2 <--- current project

Other examples

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).