FatJar : Verticle.stop() not executed when I execute 'java .. stop app'

266 views
Skip to first unread message

Dave Slash

unread,
May 29, 2017, 12:38:27 AM5/29/17
to vert.x
Hello,

I have a simple vertex app, with one verticle with some operations in start() and stop() methods.
The stop() method executes an HTTP request.

When I execute the code inside a main ;
-Build vertx instance
-Deploy the verticle
-Wait for 5 seconds
-Undeploy the verticle
>> The HTTP request is sent. 

When I package this application into a single fat jar, I launch the app with this command line :
> java -jar app.jar start -Dvertx-id=app

Then, I stop it :
> java -jar app.jar stop app

The java process is killed, but the HTTP request in the stop method of my single verticle is not executed, because the stop method is not called.

How trigger the stop method of the verticle when I use 'java .. stop app' ?

Thanks
Regards,
Dave




Jochen Mader

unread,
May 29, 2017, 2:59:21 AM5/29/17
to ve...@googlegroups.com
Sounds like you are running into this:
https://github.com/eclipse/vert.x/issues/1972

--
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+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/fc2de560-72c2-4cbf-b3e6-5146ad082716%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jochen Mader | Lead IT Consultant

codecentric AG | Elsenheimerstr. 55a | 80687 München | Deutschland
tel: +49 89 215486633 | fax: +49 89 215486699 | mobil: +49 152 51862390
www.codecentric.de | blog.codecentric.de | www.meettheexperts.de

Sitz der Gesellschaft: Düsseldorf | HRB 63043 | Amtsgericht Düsseldorf
Vorstand: Michael Hochgürtel . Rainer Vehns
Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Klaus Jäger . Jürgen Schütz

Clement Escoffier

unread,
May 30, 2017, 11:44:52 AM5/30/17
to ve...@googlegroups.com
Hi,

I should work. How did you write the stop method. You have to use the “future” version like:

public void stop(Future<Void> future) {
vertx.setTimer(1000, l -> {
System.out.println("Stopping...");
future.complete();
});
}

Clement

--
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.
Reply all
Reply to author
Forward
0 new messages