I'm working on some sort of platform where we would like to upload and deploy verticles and have them register on the event bus so we can send to them as some type "service"Is it possible in vertx 3 to deploy a verticle and any dependency jars dynamically?
--
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.
On 6 Mar 2015 at 14:41:58, javadevmtl (java.d...@gmail.com) wrote:
So the nomment you call service:... it looks for it in maven repo? And add it to the class path or you have to add it to class path?
On 6 Mar 2015 at 23:55:37, javadevmtl (java.d...@gmail.com) wrote:
OK but when programmatically calling deployVerticle () using maven service factory an exception is thrown saying it can't find the .json
That;'s fine. but you still require the json descriptor so that means I need to stop my application provide the json so it can be put in classpath and then restart the application. Or am i missing something?
On 09/03/15 15:34, javadevmtl wrote:
That;'s fine. but you still require the json descriptor so that means I need to stop my application provide the json so it can be put in classpath and then restart the application. Or am i missing something?
Yes. The json descriptor is owned by the service, not the service user.
Tim thanks I read all that. But I guess we cannot get away without stopping, putting the json in classpath and restarting.
On 09/03/15 15:44, javadevmtl wrote:
Tim thanks I read all that. But I guess we cannot get away without stopping, putting the json in classpath and restarting.
Yes, you can.
You could either use the maven-service-factory as Julien mentioned.
Or you could deploy your own stuff dynamically using isolation groups.
public static void main(String[] args) { Vertx vertx = Vertx.vertx(); DeploymentOptions options = new DeploymentOptions().setInstances(1);
vertx.deployVerticle("service:io.vertx:vertx-jdbc-service:3.0.0-milestone2",options); }
On 09/03/15 15:47, Tim Fox wrote:
On 09/03/15 15:44, javadevmtl wrote:
Tim thanks I read all that. But I guess we cannot get away without stopping, putting the json in classpath and restarting.
Yes, you can.
You could either use the maven-service-factory as Julien mentioned.
Or you could deploy your own stuff dynamically using isolation groups.
https://vertx.ci.cloudbees.com/view/vert.x-3/job/vert.x3-website/ws/target/site/docs/vertx-core/java/index.html#_verticle_isolation_groups
public class Main {
public static void main(String[] args) { Vertx vertx = Vertx.vertx(); DeploymentOptions options = new DeploymentOptions().setInstances(1);
vertx.deployVerticle("service:io.vertx:vertx-jdbc-service:3.0.0-milestone2",options); }
}
apply plugin: 'java'apply plugin: 'eclipse'
sourceCompatibility = 1.8version = 'XYZ'jar { manifest { attributes 'Implementation-Title': '...', 'Implementation-Version': version }}
repositories { mavenCentral() maven { } }
dependencies {
compile group: 'io.vertx', name: 'vertx-maven-modules', version: '3.0.0-SNAPSHOT' compile group: 'io.vertx', name: 'vertx-core', version: '3.0.0-SNAPSHOT'}
Yes, that looks like it. I've now made the service name consistent with
the way the other services are named.
Mar 13, 2015 5:16:19 PM io.vertx.core.impl.DeploymentManager
SEVERE: Cannot find file io.vertx.vertx-jdbc-service.json on classpath
Turns out quite a few of the 1st party vertx service descriptors are currently named that way, in contrast e.g. com.englishtown.vertx.vertx-solr-service.json gets it "right" - i.e. what the maven service factory currently expects.
I note e.g. the felix project's maven plugin for osgi bundles actually applies a sort of groupId/artifactId tail/head coalescing for naming in some places which sounds similar to the mental rule people have presumably been using when naming. Beh, still seems dangerously "clever" to me...
But a more tricky issue arises: at least one of the source trees looks like they end up (possibly quite reasonably) having several service descriptors (e.g. vertx-mysql-postresql-service) inside artifacts, thus an assumption of a 1:1 maven GAV coord correspondence may have been broken some time ago.
Unless copies are uploaded multiple times under all the different coords...
I dunno, the intra-jar service descriptor, while arguably DRY and enough (and already working ...if the naming is right), may thus prove a problematic approach, one could consider also maintaining detached service.descriptor.json copies outside jars i.e. upload service descriptions themselves to maven repos under "vertxservice" (or whatever) classifier - and have the maven service factory discover based on those. (mentioned something like that a fair while back on vertx-dev) i.e. "another level of indirection solves everything (except too many levels of indirection)".
On Friday, 13 March 2015 17:50:30 UTC, dgo...@squaredfinancial.com wrote:On Friday, 13 March 2015 11:13:47 UTC, Tim Fox wrote:
Yes, that looks like it. I've now made the service name consistent with
the way the other services are named.
just minor type/thinko: I don't think there's any logic to coalesce the maven groupId tail and artifactId head when constructing the service identifier (and IMO there probably shouldn't be, seems a bit "clever"), so I think it has to be (admittedly redundant looking but it's just a degenerate case):
io.vertx.vertx-jdbc-servce.json
but at time of writing you've still got io.vertx.jdbc-service.json
so I'm still seeing:
Mar 13, 2015 5:16:19 PM io.vertx.core.impl.DeploymentManager
SEVERE: Cannot find file io.vertx.vertx-jdbc-service.json on classpath
Also how would one deploy a Ruby verticle inside a jar file with the maven-service-factory in vertx-x3?
--