atmosphere-vertx Server

atmosphere-vertx: A HTTP/WebSocket server powered by Atmosphere and Vert.x Framework

License

License

GroupId

GroupId

org.atmosphere
ArtifactId

ArtifactId

atmosphere-vertx
Last Version

Last Version

3.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

atmosphere-vertx Server
atmosphere-vertx: A HTTP/WebSocket server powered by Atmosphere and Vert.x Framework

Download atmosphere-vertx

How to add to project

<!-- https://jarcasting.com/artifacts/org.atmosphere/atmosphere-vertx/ -->
<dependency>
    <groupId>org.atmosphere</groupId>
    <artifactId>atmosphere-vertx</artifactId>
    <version>3.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.atmosphere/atmosphere-vertx/
implementation 'org.atmosphere:atmosphere-vertx:3.0.0'
// https://jarcasting.com/artifacts/org.atmosphere/atmosphere-vertx/
implementation ("org.atmosphere:atmosphere-vertx:3.0.0")
'org.atmosphere:atmosphere-vertx:jar:3.0.0'
<dependency org="org.atmosphere" name="atmosphere-vertx" rev="3.0.0">
  <artifact name="atmosphere-vertx" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.atmosphere', module='atmosphere-vertx', version='3.0.0')
)
libraryDependencies += "org.atmosphere" % "atmosphere-vertx" % "3.0.0"
[org.atmosphere/atmosphere-vertx "3.0.0"]

Dependencies

compile (6)

Group / Artifact Type Version
org.atmosphere : atmosphere-runtime jar 2.4.20
io.vertx : vertx-core jar 3.5.0
io.vertx : vertx-web jar 3.5.0
org.slf4j : slf4j-api jar 1.6.4
ch.qos.logback : logback-classic jar 1.0.7
org.apache.geronimo.specs : geronimo-servlet_3.0_spec jar 1.0

test (3)

Group / Artifact Type Version
org.atmosphere : atmosphere-jersey jar 1.1.0.RC3
com.ning : async-http-client jar 1.7.16
org.testng : testng jar 5.8

Project Modules

There are no modules declared in this project.

Vertosphere: A Java WebSocket and HTTP server powered by the Atmosphere Framework and the Vert.x Framework.

The easiest way to get started with Vert.x is to download a sample and start it. Or look at the Javadoc. Samples are available here

   % mvn package; jdebug -jar target/vertx-chat-xxx-fat.jar

Samples are the same as then one available in Atmosphere, e.g everything that works with Atmosphere works AS-IT-IS with the Vert.x module.

Download using Maven

     <dependency>
         <groupId>org.atmosphere</groupId>
         <artifactId>atmosphere-vertx</artifactId>
         <version>3.0.1</version>
     </dependency>

JDK8 JDK11 JDK13

For example, the famous multi-room Chat application in Atmosphere Can be run on top of Vert.x by doing:

public class VertxChatServer extends AbstractVerticle {

    private static final Logger logger = LoggerFactory.getLogger(VertxChatServer.class);

    private HttpServer httpServer;
    private Vertx vertx;

    @Override
    public void init(Vertx vertx, Context context) {
        this.vertx = vertx;
        httpServer = vertx.createHttpServer();
    }

    @Override
    public void start(Future<Void> future) throws Exception {
        VertxAtmosphere.Builder b = new VertxAtmosphere.Builder();

        b.resource(ChatRoom.class).httpServer(httpServer).url("/chat/:room")
                .webroot("src/main/java/org/atmosphere/vertx/samples/webroot/")
                .vertx(vertx)
                .build();
        httpServer.listen(8080);
    }

    @Override
    public void stop(Future<Void> future) throws Exception {
        httpServer.close();
    }
}

Same for Jersey. You can run any Jersey resource like can be boostrapped by doing

public class VertxJerseyChat extends AbstractVerticle {

    private HttpServer httpServer;
    private Vertx vertx;

    @Override
    public void init(Vertx vertx, Context context) {
        this.vertx = vertx;
        httpServer = vertx.createHttpServer();
    }

    @Override
    public void start(Future<Void> future) throws Exception {
        VertxAtmosphere.Builder b = new VertxAtmosphere.Builder();

        b.resource(ResourceChat.class).httpServer(httpServer).url("/chat/:room")
                .webroot("src/main/webapp/")
                .initParam(ApplicationConfig.WEBSOCKET_CONTENT_TYPE, "application/json")
                .vertx(vertx)
                .build();
        httpServer.listen(8080);
    }

    @Override
    public void stop(Future<Void> future) throws Exception {
        httpServer.close();
    }
}

[Analytics]

org.atmosphere

Atmosphere Framework

Versions

Version
3.0.0
2.1.0
2.0.1
2.0.0
1.0.0
1.0.0.RC1
1.0.0.beta1