Advertisement
shakasu

Untitled

Mar 1st, 2021
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. package spring;
  2.  
  3. import io.vertx.core.Vertx;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.boot.SpringApplication;
  6. import org.springframework.boot.autoconfigure.SpringBootApplication;
  7. import org.springframework.boot.context.event.ApplicationReadyEvent;
  8. import org.springframework.context.annotation.Bean;
  9. import org.springframework.context.event.EventListener;
  10. import spring.verticles.ProxyVerticle;
  11.  
  12. @SpringBootApplication
  13. public class VertxSpringApplication {
  14.  
  15.     @Autowired
  16.     private ProxyVerticle proxyVerticle;
  17.  
  18.     public static void main(String[] args) {
  19.         SpringApplication.run(VertxSpringApplication.class, args);
  20.     }
  21.  
  22.     @Bean
  23.     public Vertx vertx() {
  24.         return Vertx.vertx();
  25.     }
  26.  
  27.     @EventListener
  28.     public void deployVerticle(ApplicationReadyEvent event) {
  29.         final Vertx vertx = this.vertx();
  30.         vertx.deployVerticle(proxyVerticle);
  31.     }
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement