This version (2017/05/27 13:44) is a draft.
Approvals: 0/1

[07:24:03] * ChanServ sets mode: +o purplefox [09:10:30] * ChanServ sets mode: +o purplefox

[09:40:37] <temporalfox> hi pmlopes can you review the vertx-codegen PR I've done yesterday ?

[09:40:50] <pmlopes> good morning, yes i will

[09:43:30] <temporalfox> good morning :-)

[10:26:45] * ChanServ sets mode: +o purplefox [11:14:41] * ChanServ sets mode: +o purplefox

[14:01:48] * ChanServ sets mode: +o purplefox [18:50:23] <melvinross_> has anyone successfully deployed a verticle with config params from a JS? I've been trying to give it a go, but everything is pointing towards the configuration parameters not being passed at deployment time [19:31:46] <AlexLehm> melvinross_: i think the config for the verticle is under a key “config” in the deployment options [19:32:57] <melvinross_> yeah i figured out what was going on [19:33:11] <melvinross_> if you pass it in via the constructor, you need the “config” key [19:33:26] <melvinross_> but if you use the setConfig function, then the key isn't required [19:34:35] <melvinross_> the third party module I'm trying to use only ever used the setConfig method, so the inclusion of the config is totally omitted in all their documentation [19:34:57] <melvinross_> i realized it after reading the source for DeploymentOptionConverter in core [19:38:20] <melvinross_> though the whole thing makes me wonder whether or not the java docs could be made more clear [19:39:54] <melvinross_> because as of now, “setConfig” reads as if it's a synonym for the constructor [19:40:54] <melvinross_> “when it's deployed” vs “when deploying the verticle” i guess is the difference in language [20:28:46] <BadApe> can i have a custom constructor for an abstract verticle? [20:34:21] <melvinross_> why couldn't you? [20:34:41] <melvinross_> only downside is you couldn't deploy with a string from another vertical [20:35:06] <melvinross_> damn autocorrect [20:39:47] <Lecherito> How can I know if my verticle and router are up? I'm getting no response! [20:41:36] <melvinross_> no response or hanging/timeout? [20:41:52] <Lecherito> Nope [20:42:30] <melvinross_> if you don't call .end() then the default behavior looks as if the connection is going into neverland until the timeout callback gets called [20:43:38] <melvinross_> i'd also suggest some logging around your route creation to make sure your route is actually added to the router [20:48:13] <MohsenK> Hi guys [20:50:29] <Lecherito> https://www.irccloud.com/pastebin/Agi8pBGb/ [20:51:00] <Lecherito> This is my verticle, the one never returning :( [20:51:37] <Lecherito> It is being added to the route because I can see it debugging [20:55:31] <melvinross_> unless you edited it out, you never created an http server… [20:56:16] <Lecherito> https://www.irccloud.com/pastebin/MdBGRiA6/ [20:56:19] <Lecherito> I do it in main [20:57:21] <Lecherito> Or is it possible to create a new http server for each Verticle and own router instead of one for all of them? [20:57:42] <melvinross_> sure it's possible, but not necessary [20:58:06] <melvinross_> how exactly are you passing the router object? [20:58:34] <melvinross_> inside of the manager object? [20:58:39] <Lecherito> Yep [20:58:45] <Lecherito> no [20:58:46] <Lecherito> static [20:58:53] <Lecherito> right now I'm just testing and seeing how this works [20:59:06] <Lecherito> trying to migrate from another frameworks [20:59:49] <BadApe> i don't understand how http://vertx.io/blog/vert-x-application-configuration/index.html DeploymentOptions options = new DeploymentOptions() and after it is passed in the key http.port can be accessed as port [21:01:41] <BadApe> something like String url = config().getString(key) etc [21:01:52] <melvinross_> where do you see that? [21:01:58] <BadApe> https://github.com/vert-x3/vertx-examples/blob/master/core-examples/src/main/java/io/vertx/example/core/verticle/deploy/OtherVerticle.java [21:02:02] <melvinross_> all i see is it accessing “http.port” [21:02:14] <melvinross_> then it generates a random port, puts that into a variable named port [21:02:16] <BadApe> vertx.createHttpClient().getNow(port, “localhost”, “/”, response → { [21:02:25] <BadApe> now did port get it's value? [21:02:43] <Lecherito> As far as I know BadApe, you can add a config file when doing a run Verticle -config config.file [21:02:58] <Lecherito> That will lead to a jsonobject accessed by config() [21:04:17] <BadApe> i just think i hadn't realised i needed something like String url = config().getString(“db.url”); [21:06:06] <melvinross_> i don't think those two snippets are suppose to be read as distinct pieces of code [21:06:27] <melvinross_> i thin port in the createHtttp is the same port that's definite as port =8081 [21:06:32] <BadApe> i was just stupid and didn't understand what happened to options [21:07:00] <BadApe> another stupid question, vertx.executeBlocking(future → { } - can't i extend a class rather than using that lambda [21:09:20] <melvinross_> you need to implement the handler interface i believe [21:10:09] <BadApe> or do i just do DeploymentOptions options = new DeploymentOptions().setWorker(true); [21:12:11] <melvinross_> but at that point you have to define an entire verticle to deploy [21:12:44] <melvinross_> if it's something really substantial that would make sense [21:13:14] <melvinross_> but otherwise, you may want to just use the lamba, or a named function inside of your class and use the :: reference [21:13:26] <melvinross_> really depends on what you're doing if you ask me [21:13:41] <melvinross_> in my POCs i've done both [21:14:06] <BadApe> i am just messing seeing how things work right now [21:14:45] <BadApe> what do you mean inside the class use the :: reference? [21:15:43] <melvinross_> you can reference an already existing method [21:15:49] <melvinross_> instead of creating a lamda [21:16:34] <melvinross_> so long as that method shares the same method signature as the lambda you would have created [21:16:45] <melvinross_> http://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html [21:17:09] <melvinross_> it's what “router::accept” is doing when you use the router [21:18:38] <melvinross_> @Lecherito my money is still on a scope problem [21:22:31] <BadApe> oh hmm [21:23:19] <melvinross_> i use them all the time. in my experience, humans like named functions [21:23:36] <Lecherito> I'll try to create a new http [21:23:55] <BadApe> i created a really bad bit of code http://pastie.org/10405992 [21:24:04] <melvinross_> i'd say it's your router reference that's the problem [21:24:47] <melvinross_> i imagine you're leaving off scoping keyword to make it private to different packages but public inside current package? [21:25:09] <melvinross_> which should work just fine [21:25:13] <BadApe> oops forgot the private keyword [21:26:09] <BadApe> but this verticle is going to have to be a worker, i am sure that the db.save() is blocking [21:28:00] <melvinross_> makes sense [21:29:47] <BadApe> if i make this nice and light, i can have the expensive domain logic in another verticle and send json documents to be updated [21:33:29] <melvinross_> what i'm not sure of is how the event bus behaves inside of worker vertices [21:34:26] <BadApe> me either, [21:36:13] <melvinross_> if they're blocking and you're hammering away at the eventbus to send messages, does it just rely on plain old context switching? [21:36:21] <melvinross_> maybe it's something we should ask in the google group [21:38:31] <melvinross_> i swear i read something from vertx 2 that said you couldn't use the eventbus inside a worker verticle [21:38:39] <melvinross_> but haven't found anything for vertx 3 that says that [22:11:29] <AlexLehm> sorry, i accidentally pushed to the vert-x3 repo first since i confused origin and upstream [22:12:13] <AlexLehm> i will write a msg to the dev group later [22:17:31] <Sticky> you can just push a revert, will still be in history, but will then allow you to do a propper PR [22:21:01] * ChanServ sets mode: +o purplefox

[22:30:06] <melvinross_> since T. Fox is in the room i'll throw it out there. How do worker vertices handle communication on the event bus? Do they rely on regular context switching to read new messages off the bus while working on blocking code?

[22:40:43] <Lecherito> do I have to use io.vertx.core.Starter with program arguments run “verticleclass” to start a verticle?

[22:40:50] <Lecherito> If so, not even the hello world is working for me :(

[22:42:37] <melvinross_> vertx run file.java/js/whatever will work if it's installed on your system

[22:43:08] <Lecherito> I haven't installed vertx here

[22:43:41] <melvinross_> so you're using maven/gradle then and embedding vertx

[22:43:51] <Lecherito> Yep, maven

[22:46:03] <melvinross_> should look something like this

[22:46:18] <melvinross_> <Main-Class>io.vertx.core.Starter</Main-Class>

[22:46:18] <melvinross_> <Main-Verticle>${main.verticle}</Main-Verticle>

[22:46:41] <melvinross_> where main.verticle is a property with your actual class name in it

[22:47:06] <melvinross_> i guess you could skip the abstraction and just put in the class name too

[22:47:33] <melvinross_> what guide are you trying to follow by the way?

[22:47:56] <melvinross_> i found http://vertx.io/blog/my-first-vert-x-3-application/index.html to be most complete when i was trying to start out

[22:48:19] <Lecherito> Right now I just tried the http://vertx.io/ hello wold there

[22:56:10] <Lecherito> It is weird, the method with start(Future<Void>) is the one being called, not start()

[22:58:02] <Lecherito> That's why ._.

[22:59:15] <melvinross_> that's the expected behaviour

[22:59:45] <melvinross_> though you're right

[22:59:52] <melvinross_> that stub on the homepage just calls start

[23:01:04] <Lecherito> Yeah but I spent one day trhing to debug it with a breakpoint in the very first line

[23:01:14] <Lecherito> with no luck so I thought I was starting it the wrong way

[23:01:19] <melvinross_> that example might actually work

[23:01:31] <Lecherito> But what is the difference between start and start with future?

[23:01:32] <melvinross_> if you have vertx installed on your system

[23:01:45] <melvinross_> i'm going to C&P and give it a go

[23:03:10] <Lecherito> But it seems that nope with IntelliJ and starter

[23:03:10] <melvinross_> yeah

[23:03:32] <melvinross_> it runs with a call to vertx run Server.java

[23:07:44] <Lecherito> I think im just retarded to understand this system, wtf

[23:08:18] <melvinross_> naw

[23:08:29] <melvinross_> just the configurations are a little different depending on how you're running it

[23:09:14] <melvinross_> i've founded installing vertx and using the CLI was the fastest by far

[23:09:41] <Lecherito> But for deploys I'd like to have just my jar file

[23:10:02] <melvinross_> but you aren't even at that point yet

[23:10:11] <melvinross_> aren't you just testing it out?

[23:10:26] <Lecherito> Yep

[23:10:38] <melvinross_> seems like you should spend your time writing your actual code and worrying about maven later

[23:11:08] <melvinross_> between the ton of examples and the vertx archetype for maven, it's pretty much a solved problem

[23:11:18] <melvinross_> you just gotta look in the right place

[23:13:21] <melvinross_> i assure you it works just fine in maven. I'm using it for one of my POCs to include the 3rd party kafka vertical

[23:13:33] <melvinross_> i do suggest you read through the my first vertx 3 application blog post

[23:13:43] <melvinross_> it was a great help for me

[23:18:28] <Lecherito> I think i got it answering!