--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/0ca7c8e8-27dc-4f09-bb46-3d9b254976de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
package io.vertx.simple;import java.io.FileInputStream;import java.io.IOException;import java.util.Properties;import io.vertx.core.AbstractVerticle;import io.vertx.core.DeploymentOptions;import io.vertx.core.Future;import io.vertx.core.Handler;import io.vertx.core.Vertx;import io.vertx.core.VertxOptions;import io.vertx.core.buffer.Buffer;import io.vertx.core.http.HttpServerOptions;import io.vertx.core.http.ServerWebSocket;import io.vertx.core.logging.Logger;import io.vertx.core.logging.LoggerFactory;import io.vertx.core.logging.SLF4JLogDelegateFactory;import io.vertx.core.net.JksOptions;public class VideoChatVerticle extends AbstractVerticle {Logger logger = LoggerFactory.getLogger(VideoChatVerticle.class);@Overridepublic void start(Future<Void> fut) throws Exception {logger.debug("Verticle started " + Thread.currentThread().getName());HttpServerOptions options = new HttpServerOptions().setSsl(true).setWebsocketSubProtocols("wss").setKeyStoreOptions(new JksOptions().setPath("keystore.jks").setPassword("password"));vertx.createHttpServer(options).websocketHandler(webSocket -> {logger.debug("New client connected: " + ((ServerWebSocket) webSocket).remoteAddress());logger.debug("path= " + webSocket.path());logger.debug("uri= " + webSocket.uri());logger.debug("localAddress= " + webSocket.localAddress());logger.debug("textHandlerID= " + webSocket.textHandlerID());webSocket.handler(new Handler<Buffer>() {public void handle(Buffer data) {logger.debug(data.toString());}});webSocket.closeHandler(new Handler<Void>() {@Overridepublic void handle(Void arg0) {logger.debug("Close handler. arg0=" + arg0);}});});}public static void main(String[] args) {Properties properties = new Properties();try {properties.load(new FileInputStream("app.properties"));} catch (IOException e) {e.printStackTrace();System.exit(-1);}int numInstance = Integer.valueOf(properties.getProperty("numInstance"));System.setProperty(LoggerFactory.LOGGER_DELEGATE_FACTORY_CLASS_NAME, SLF4JLogDelegateFactory.class.getName());VertxOptions options = new VertxOptions();options.setBlockedThreadCheckInterval(1000*60*60);DeploymentOptions deploymentOptions = new DeploymentOptions().setInstances(numInstance).setHa(false);Vertx.vertx(options).deployVerticle(VideoChatVerticle.class.getName(), deploymentOptions);}}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.vertx.simple</groupId>
<artifactId>simple</artifactId>
<packaging>jar</packaging>
<version>0.1</version>
<name>Project - simple</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-unit</artifactId>
<version>3.2.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-hazelcast</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>io.vertx.core.Starter</Main-Class>
<Main-Verticle>io.vertx.simple.VideoChatVerticle</Main-Verticle>
</manifestEntries>
</transformer>
</transformers>
<artifactSet/>
<outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/92b42dfb-4857-4f8d-b041-bb701cc0ce79%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/1b4ed11d-42fd-4e0f-8acb-91b56ef6dda3%40googlegroups.com.
VertxOptions options = new VertxOptions();
options.setBlockedThreadCheckInterval(1000*60*60);
Thank you!
Gwowen
...