JsonObject config = new JsonObject().put("name", "tim").put("directory", "/blah");
config.put("address", "mye...@gmail.com");
DeploymentOptions options = new DeploymentOptions().setConfig(config);
vertx.deployVerticle("service:io.vertx:vertx-mail", options );
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-maven-service-factory</artifactId>
<version>${vertx.version}</version>
</dependency>--
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.
For more options, visit https://groups.google.com/d/optout.
yo yo infologger
log4j:WARN No appenders could be found for logger (io.netty.util.internal.logging.InternalLoggerFactory).
log4j:WARN Please initialize the log4j system properly.
io.vertx.ext.mail.MailServiceVerticle
java.lang.ClassNotFoundException: io.vertx.ext.mail.MailServiceVerticle
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
vertx-service-factory
vertx-maven-service-factory
vertx-service-proxyvertx-service-factor
vertx-maven-service-factoryvertx.deployVerticle("service:com.mycompany:clever-db-service:1.0",new DeploymentOptions(config), res -> {
if (res.succeeded()) {
log.info("com.eform.verticles.EmailServiceVerticle: Deployment id is: " + res.result());
} else {
log.warn("com.eform.verticles.EmailServiceVerticle: Deployment failed!");
}
});
vertx.deployVerticle("service:com.eform:email-service:1.0-SNAPSHOT",new DeploymentOptions(config), res -> {
if (res.succeeded()) {
log.info("com.eform.verticles.EmailServiceVerticle: Deployment id is: " + res.result());
} else {
log.warn("com.eform.verticles.EmailServiceVerticle: Deployment failed!");
}
});
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4.1:single (package-vertx-service) on project eform-email-service: Error reading assemblies: Descriptor with ID 'eform-email-service' not found -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4.1:single (package-vertx-service) on project eform-email-service: Error reading assemblies: Descriptor with ID 'eform-email-service' not found
com.eform.eform-email-service.1.0-SNAPSHOT.json
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.eform</groupId>
<version>1.0-SNAPSHOT</version>
<artifactId>eform-email-service</artifactId>
<name>eform-email-service</name>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<properties>
<vertx.version>3.0.0-SNAPSHOT</vertx.version>
</properties>
<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>3.0.0-dev_preview1</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-service-factory</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-maven-service-factory</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-service-proxy</artifactId>
<version>${vertx.version}</version>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-mail</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.0.1</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<!-- We specify the Maven compiler plugin as we need to set it to Java
1.8 -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- Define an assembly execution for packaging the vertx service that
can be reused by children modules -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-service-factory</artifactId>
<version>${vertx.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>package-vertx-service</id>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>com.eform.eform-email-service</descriptorRef>
</descriptorRefs>
</configuration>
<phase>package</phase>
</execution>
</executions>
</plugin>
<!-- Fat executable jars If you want your project to output a fat executable
standalone jar with all the dependencies in it you can use the shade 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>com.app.starter.ApplicationStarter</Main-Class>
</manifestEntries>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/services/io.vertx.core.spi.VerticleFactory</resource>
</transformer>
</transformers>
<artifactSet>
<!-- By default all the deps go into the fat jar, but we don't need
some so we can exclude them here -->
<excludes>
<exclude>io.vertx:vertx-codegen</exclude>
<exclude>junit:junit</exclude>
<exclude>org.mvel:mvel2</exclude>
<exclude>log4j:log4j</exclude>
<exclude>org.slf4j:slf4j-api</exclude>
</excludes>
</artifactSet>
<outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4.1:single (package-vertx-service) on project eform-email-service: Error reading assemblies: Descriptor with ID 'vertx-service' not found -> [Help 1]
Thanks Johannes. Hello Tim,
I've created a simple project on git. https://github.com/ThoughtApps/vert-x3-example
I'm just trying to understand a few things:
1) How to call a verticle as a service.
If you are deploying the service via maven, I think you have to install the maven package in your local repo with mvn install at least once.
Thanks Johannes. Hello Tim,
I've created a simple project on git. https://github.com/ThoughtApps/vert-x3-example
...