Skip to content

Instantly share code, notes, and snippets.

Created May 13, 2015 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9d9e2288aa23688fc0f0 to your computer and use it in GitHub Desktop.
Save anonymous/9d9e2288aa23688fc0f0 to your computer and use it in GitHub Desktop.
Process not dying sample
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Server2 extends AbstractVerticle {
private static final Logger logger = LoggerFactory.getLogger(Server2.class);
@Override
public void start(final Future<Void> onStartup) {
try {
// let's pretend there's a problem
throw new RuntimeException("some problem");
} catch (Exception e) {
logger.error("start - failed ex:", e);
onStartup.fail(e);
vertx.close();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment