Differences

This shows you the differences between two versions of the page.

Link to this comparison view

irc:1447282800 [2017/05/27 13:44] (current)
Line 1: Line 1:
 +[03:59:09] <​Shaika-Dzari>​ Hello
 +
 +[04:00:10] <​Shaika-Dzari>​ I'm building a small proxy using vert.x
 +
 +[04:00:37] <​Shaika-Dzari>​ I'm using the HttpClient but I have a small problem...
 +
 +[04:02:11] <​Shaika-Dzari>​ I can't find a way to specify a header when using client.request(method,​ host, path, Handler)
 +
 +[04:03:00] <​Shaika-Dzari>​ This method is calling a private function doRequest in HttpClientImp and the header map in this function is always null
 +
 +[12:19:28] <​kislo_metal>​ Hi all
 +
 +[12:20:27] <​kislo_metal>​ I am using vertx-maven-plugin and I am trying to understand the behave of configFile
 +
 +[12:20:55] <​kislo_metal>​ <​groupId>​io.vertx</​groupId>​
 +
 +[12:20:55] <​kislo_metal> ​                <​artifactId>​vertx-maven-plugin</​artifactId>​
 +
 +[12:20:55] <​kislo_metal> ​                <​version>​2.0.12-final</​version>​
 +
 +[12:20:57] <​kislo_metal> ​                <​configuration>​
 +
 +[12:20:59] <​kislo_metal> ​                    <​configFile>​src/​main/​conf/​application-conf.json</​configFile>​
 +
 +[12:21:01] <​kislo_metal> ​                    <​instances>​1</​instances>​
 +
 +[12:21:03] <​kislo_metal> ​                </​configuration>​
 +
 +[12:21:53] <​kislo_metal>​ where is the resulting configuration should appear in fat jar file?
 +
 +[12:23:39] <​AlexLehm>​ kislo_metal:​ is this for vert.x 2?
 +
 +[12:24:00] <​kislo_metal>​ no, for vert.x 3
 +
 +[12:25:33] <​AlexLehm>​ vertx-maven-plugin is for vert.x 2 I think, this is not required in vert.x 3 since that uses "​normal"​ fatjars
 +
 +[12:39:31] <​kislo_metal>​ could you show an example ​ to build fatjars for vert.x3 ?
 +
 +[12:42:00] <​AlexLehm>​ https://​github.com/​vert-x3/​vertx-examples/​tree/​master/​maven-simplest
 +
 +[12:42:12] <​AlexLehm>​ or https://​github.com/​vert-x3/​vertx-examples/​tree/​master/​maven-verticles if you want to use verticles directly
 +
 +[12:47:09] <​kislo_metal>​ for this fat jar configuration I could specify -conf <config file> on startup ?
 +
 +[12:48:44] <​AlexLehm>​ i think the conf file is resolved via the classpath, so it should be available if you put it into src/​main/​resouces
 +
 +[12:48:54] <​AlexLehm>​ at least i think it does
 +
 +[12:56:15] <​kislo_metal>​ ok, I tried it.. and it did work as expected. Here is my setup: I have configuration file in src/​main/​resources ​ : application-conf.json = {"​http.port"​ :8085}
 +
 +[12:56:46] <​kislo_metal>​ I created fat jar and it contains the configuration file in the root
 +
 +[12:58:13] <​kislo_metal>​ I am trying to do live re-deploy for my verticle using fat jar that contains dependencies and configuration file (I am adding actual vertices to the classpath)
 +
 +[12:58:28] <​kislo_metal>​ java -classpath pag-build/​target/​pag-build-0.0.1-SNAPSHOT-dependency-fat.jar io.vertx.core.Launcher run com.diosoft.pag.zones.ZonesVerticle -conf application-conf.json -worker -cp classes:​pag-services-zones/​target/​classes/​ --redeploy="​pag-services-zones/​target/​classes/​**/​*.class"​
 +
 +[12:59:08] <​kislo_metal>​ is the way I am specifying --conf is correct?
 +
 +[13:01:02] <​kislo_metal>​ in verticle I have - LOGGER.info("​HTTP port ?? : " +config().getInteger(CONFIG_HTTP_PORT)); ​ //​CONFIG_HTTP_PORT = "​http.port";​
 +
 +[13:01:19] <​kislo_metal>​ and on run I get NFO: HTTP port ?? : null
 +
 +[13:03:02] <​AlexLehm>​ I am not sure if the classpath pics up .json files, it might be better to write the relative path of the conf file into the parameter
 +
 +[13:03:27] <​AlexLehm>​ like -conf src/​main/​resources/​application-conf.json
 +
 +[13:03:32] <​AlexLehm>​ but I'm not sure
 +
 +[13:46:12] <​kislo_metal>​ I tried with relative and full path - no luck :(
 +
 +[13:51:09] <​AlexLehm>​ or you have to add the path of the conf file to the classpath, e.g. -cp pag-build/​src/​main/​resources or -cp . depending on where the file is
 +
 +[14:08:02] <​kislo_metal>​ nope...
 +
 +[14:08:08] <​AlexLehm>​ kislo_metal:​ how are you creating the SNAPSHOT-dependency-fat jar? does this include your project or does it include the conf file?
 +
 +[14:08:11] <​kislo_metal>​ so I figure out what is the issue
 +
 +[14:08:51] <​AlexLehm>​ maybe its reading the file from the fatjar before the local one
 +
 +[14:09:15] <​kislo_metal>​ it include the dependencies and config - I supply actual classes with -cp
 +
 +[14:09:43] <​kislo_metal>​ the issue that I got is related to --redeploy
 +
 +[14:10:11] <​kislo_metal>​ This command works just fine:
 +
 +[14:10:12] <​kislo_metal>​ java -classpath pag-build/​target/​pag-build-0.0.1-SNAPSHOT-dependency-f.jar io.vertx.core.Launcher run com.diosoft.pag.zones.ZonesVerticle --conf pag-build/​src/​main/​resources/​application-conf.json -worker -cp classes:​pag-services-zones/​target/​classes/​
 +
 +[14:11:06] <​kislo_metal>​ but, as soon as i try to do redeploy, the configuration was not able to load
 +
 +[14:11:28] <​kislo_metal>​ java -classpath pag-build/​target/​pag-build-0.0.1-SNAPSHOT-dependency-fat.jar io.vertx.core.Launcher run com.diosoft.pag.zones.ZonesVerticle --conf pag-build/​src/​main/​resources/​application-conf.json -worker -cp classes:​pag-services-zones/​target/​classes/​ --redeploy="​pag-services-zones/​target/​classes/​**/​*.class"​
 +
 +[14:15:49] <​AlexLehm>​ let me try that out with a sample project
 +
 +[14:18:22] <​kislo_metal>​ in source:
 +
 +[14:18:30] <​kislo_metal>​ if (redeploy == null || redeploy.isEmpty()) {
 +
 +[14:18:30] <​kislo_metal> ​      ​super.run();​
 +
 +[14:18:30] <​kislo_metal> ​      if (vertx == null) {
 +
 +[14:18:32] <​kislo_metal> ​        ​return;​ // Already logged.
 +
 +[14:18:34] <​kislo_metal> ​      }
 +
 +[14:18:36] <​kislo_metal> ​      ​JsonObject conf = getConfiguration();​
 +
 +[14:18:38] <​kislo_metal> ​      ​deploymentOptions = new DeploymentOptions();​
 +
 +[14:28:14] <​AlexLehm>​ i think the redeploy should load the config each time, so it doesn'​t do that on run
 +
 +[14:28:18] <​AlexLehm>​ but maybe that is not working
 +
 +[14:29:05] <​AlexLehm>​ if that is an issue in the vertx-code code, you are could write a bugzilla entry, this is something the core devs should take a look at
 +
 +[14:31:45] <​kislo_metal>​ Ok. in short - if redeploy is used you can specify configuration only with system properties, but I can not find the way to pass configuration and not values like workerPoolSize