Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package spring;
- import io.vertx.core.Vertx;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.boot.SpringApplication;
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import org.springframework.boot.context.event.ApplicationReadyEvent;
- import org.springframework.context.annotation.Bean;
- import org.springframework.context.event.EventListener;
- import spring.verticles.ProxyVerticle;
- @SpringBootApplication
- public class VertxSpringApplication {
- @Autowired
- private ProxyVerticle proxyVerticle;
- public static void main(String[] args) {
- SpringApplication.run(VertxSpringApplication.class, args);
- }
- @Bean
- public Vertx vertx() {
- return Vertx.vertx();
- }
- @EventListener
- public void deployVerticle(ApplicationReadyEvent event) {
- final Vertx vertx = this.vertx();
- vertx.deployVerticle(proxyVerticle);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement