Vertx options when using io.vertx.core.Launcher and "main" verticle

359 views
Skip to first unread message

javadevmtl

unread,
Feb 5, 2021, 11:21:17 AM2/5/21
to vert.x
Hi when using this method vertx is pretty much configured.

1- I'm guessing if we want to modify any options we need to pass in -D system properties, in which case are document where?

2- If using the launcher way can use the "main" verticle to create a separate vertx instance and then launch the rest of the system from the new instance or is it preferred to use an actual Java main method and embed the Vertx instance from there?

Lars Mårelius

unread,
Feb 5, 2021, 4:37:36 PM2/5/21
to ve...@googlegroups.com
Hi!

[Regarding starting a Vert.x instance from a Vert.x instance: I hope someone else can answer that]

In one of my team we are currently working on a new Runner and fiddling with startup parameters and getting settings from file, http and Kubernetes key-value store.
We hope to be able to put the code on GitHub by the end of February.

Here is some quick summary of how we handle it (WIP warning - things might change):

JSON main config file with four main keys:
"vertx: used for settings of the Vert.x instance
"cluster-manager": for hazelcast so far
"verticles": settings for the verticles started by Vert.x
"system-properties": for variables inside the verticles to avoid having hard-coded hostname, port, etc. since they depend on the environment (dev, test, prod).

JSON secrets file: <env>-config.json
Just a flat key: value file that we do not check in to Git.

JSON secrets-example file: <env>-secrets.json
Just the keys of all secrets that need to be added. Checked in -> copy, change name: dev-secrets-example.json -> dev-secrets.json and fill in the values picked from LastPass or 1Passwords.

We use mvn package to populate a file in Resources: start.properties to set value to point to where the config main and secrets files can be found.

To set the Vert.x instance we start a "vanilla vertx", read up the config to ConfigRetriever, kill that vertx and start up a new one with the found config from the file.

We also need to have Java jvm startup parameters. We are trying to find nicer ways...

I do not now if this was an answer to your problem. We are using Jib to build containers with one Vert.x instance per container and one or more verticles in them.

/Morre

----
Lars Mårelius <mo...@tentixo.com> direct: +46 70-867 09 01
Tentixo NG AB
Törnbacken 7, 170 67 Solna
> --
> 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.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/13e73424-a609-483f-96cc-1067e6e43b01n%40googlegroups.com.

signature.asc
Reply all
Reply to author
Forward
0 new messages