2017-09-17 12 views

答えて

0

はい、GitHubのサンプルリポジトリのVert.x with Springセクションをご覧ください。

+0

実際に別のクラスを作成しなくても、vert.xを統合するようになりました。しかし、あなたのソリューションも同様に機能します。ご協力いただきありがとうございます。 – heartly4u

0

春ブーツでは、それは

@SpringBootApplication 
@ComponentScan(basePackages = { "com.mypackage", "com.myotherpackage" }) 
public class MyApplication { 

    @Autowired 
    private MainVerticle mainVertical; 

    public static void main(String[] args) throws Exception { 
     new SpringApplication(MyApplication.class).run(args); 
    } 

    @PostConstruct 
    public void deployServerVerticle() { 
     Vertx.vertx().deployVerticle(mainVertical); 
    } 

} 

非常に簡単です@PostConstuctはあなたが(すべてのプロパティは、この点に設定されている)したいすべての業種を展開することができます。

MainVerticleに@Componentアノテーションを付ける必要があります。

関連する問題