Hi,
I would like to shed some clarifications on Vert.x modules from my perspective (i.e as Vert.x 2 user and Vert.x 3 developer).
I see the Vert.x 2.x module system made of :
- deployment of verticle source file or zip files
- class loader isolation
- repository system (delegated to Bintray / Maven)
What has changed in Vert.x 3 ?
Vert.x 3 removed the repository system and zip file deployment and keeps the class loader isolation and the deployment of Verticles. It means that the repository system is delegated (by default) to the build system (Maven, Gradle, etc…).
So what happens if you need to deploy a Verticle in a jar file of your repository (let’s suppose you are using Maven): the Verticle is deployed you use its classname and Vert.x assumes the current classloader being able to load the resource, for instance:
before: vertx.deployModule(“my~module~1.0”);
now: vertx.deployVerticle(“java:my.Verticle”);
+
<dependency>
<groupId>my</groupId>
<artifactId>module</artifactId>
<version>1.0</version>
</dependency>
One motivation for this seems to be the new Proxy stuff (that allows you to use a typed interface in front of a module using the event bus). If you use this feature (I’m saying *if* , this feature is optional) then you need the Proxy (it’s not only Java, it works for all languages, so you can a JS proxy for JS etc...) in your classpath which implies that the dependency has to be resolved *before* compilation by your build system and we fall in the use case of Vert.x 3.
That being said, I think (my opinion) I think a dynamic deployment system inside Vert.x is still useful (for instance I can deploy mod-web-server to serve some files, I don’t need a proxy!).
The good news is the new Vert.x verticle deployment provides more flexibility now. Basically now you provide a prefix when deploying something, for instance java:my.Verticle . The part after the prefix is completely opaque to Vert.x and will delegate it fully to the Verticle Factory. It means this can be anything you like.
I spend a couple of hours to make a proof of concept (
https://github.com/vietj/vertx-maven-modules) of a “maven” verticle factory that loads a Verticle from the Maven repository at runtime and then deploys it with code like vertx.deployVerticle("maven:my:module:1.0”)
Last but not least, you can expect a Vert.x alpha/previous release in September, so you can use it and provide feedback. And you can be sure Tim will listen to you :-)
--
Julien Viet
www.julienviet.com
> --
> 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.
>