File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 5151 </dependencies >
5252
5353 <build >
54+ <resources >
55+ <resource >
56+ <directory >src/main/resources</directory >
57+ <filtering >true</filtering >
58+ </resource >
59+ </resources >
5460 <pluginManagement >
5561 <plugins >
5662 <plugin >
8995 </transformers >
9096 <artifactSet >
9197 </artifactSet >
92- <outputFile >${project.build.directory} /${project.artifactId} -${project.version} - all.jar
98+ <outputFile >${project.build.directory} /${project.artifactId} -all.jar
9399 </outputFile >
94100 </configuration >
95101 </execution >
Original file line number Diff line number Diff line change 55*/
66package kafka .vertx .demo ;
77
8+ import io .vertx .config .ConfigRetriever ;
9+ import io .vertx .config .ConfigRetrieverOptions ;
10+ import io .vertx .config .ConfigStoreOptions ;
811import io .vertx .core .*;
12+ import io .vertx .core .json .JsonObject ;
913import io .vertx .core .spi .resolver .ResolverProvider ;
1014import org .slf4j .Logger ;
1115import org .slf4j .LoggerFactory ;
@@ -32,6 +36,15 @@ public static void main(String[] args) {
3236 .setWarningExceptionTime (10 ).setWarningExceptionTimeUnit (TimeUnit .SECONDS )
3337 .setMaxEventLoopExecuteTime (20 ).setMaxEventLoopExecuteTimeUnit ((TimeUnit .SECONDS )));
3438
39+ ConfigRetriever .create (vertx ,
40+ new ConfigRetrieverOptions ().addStore (
41+ new ConfigStoreOptions ()
42+ .setType ("file" )
43+ .setFormat ("properties" )
44+ .setConfig (new JsonObject ().put ("path" , "project.properties" ))
45+ )
46+ ).getConfig ().onSuccess (config -> logger .info ("Application version: " + config .getString ("app.version" )));
47+
3548 Future <String > periodicProducerDeployment = vertx .deployVerticle (new PeriodicProducer ());
3649 Future <String > webSocketServerDeployment = vertx .deployVerticle (new WebSocketServer ());
3750
Original file line number Diff line number Diff line change 1+ app.version =${project.version}
You can’t perform that action at this time.
0 commit comments