I have a running app in vert.x. I have many missing features or I just can say missing spring.
我有一个运行中的应用程序。我有很多缺失的特征,或者我只是说错过了春天。
How can I integrate vert.x and Spring MVC working on a Tomcat server?
我怎样才能把这个人融合在一起呢?在Tomcat服务器上工作的x和Spring MVC ?
3 个解决方案
#1
2
With Vert.x 3 I would think you would want to use the Vert.x Web capabilities as described here instead of Spring MVC if you want to give Vertx a go. It provides a different approach to developing a web application using the Multi-Reactor pattern than the traditional multi-threaded Servlet model which Spring MVC is based on. With the Servlet model every request runs on its own thread. In Vert.x there is an event loop that is single threaded. All requests are run on the same thread, which requires blocking I/O code to be written in special blocks (see Core Manual).
绿色。x 3我想你会想用这个绿色的。如果你想给Vertx一个go,这里描述的是x Web功能,而不是Spring MVC。它提供了一种不同的方法来使用多反应器模式开发web应用程序,而不是基于Spring MVC的传统多线程Servlet模型。使用Servlet模型,每个请求都在自己的线程上运行。在绿色。有一个单线程的事件循环。所有请求都是在同一个线程上运行的,这需要阻塞I/O代码以编写在特殊的块中(参见核心手册)。
#2
0
Depends on which Vert.x version you are using. 2.x requires a module. like mod-spring-appcontext. In Vert.x 3.x just create a Spring ApplicationContext in your code, typically in the entry point of your application, like your public static void main method. I can't get into more detail. Vert.x questions rarely, if ever, get noticed here.
依赖于绿色。你正在使用的x版本。2。x需要一个模块。像mod-spring-appcontext。在绿色。x 3。x在代码中创建一个Spring ApplicationContext,通常在应用程序的入口点,比如公共静态void main方法。我不能说得更详细了。绿色。在这里,x问题很少被注意到。
#3
0
I would not recommend working with vert.x on a tomcat container as there philosophies are completely different. Tomcat is a servlet container which creates different thread for each incoming call whereas vert.x works on a event-loop. If you are missing spring and will like to use its bean you can integrate it in vert.x environment and run any blocking code in worker verticles. You can see an example here : https://github.com/vert-x3/vertx-examples/tree/master/spring-examples/spring-example
我不建议和维特一起工作。在tomcat容器上的x是完全不同的。Tomcat是一个servlet容器,它为每个传入的调用创建不同的线程,而vert。x在事件循环中工作。如果你错过了春天,并且想要用它的豆子,你可以把它融入到绿色。x环境和运行任何阻塞代码在工人的verticles。您可以在这里看到一个示例:https://github.com/vert-x3/vertx-examples/tree/master/spring-examples/spring-example。
#1
2
With Vert.x 3 I would think you would want to use the Vert.x Web capabilities as described here instead of Spring MVC if you want to give Vertx a go. It provides a different approach to developing a web application using the Multi-Reactor pattern than the traditional multi-threaded Servlet model which Spring MVC is based on. With the Servlet model every request runs on its own thread. In Vert.x there is an event loop that is single threaded. All requests are run on the same thread, which requires blocking I/O code to be written in special blocks (see Core Manual).
绿色。x 3我想你会想用这个绿色的。如果你想给Vertx一个go,这里描述的是x Web功能,而不是Spring MVC。它提供了一种不同的方法来使用多反应器模式开发web应用程序,而不是基于Spring MVC的传统多线程Servlet模型。使用Servlet模型,每个请求都在自己的线程上运行。在绿色。有一个单线程的事件循环。所有请求都是在同一个线程上运行的,这需要阻塞I/O代码以编写在特殊的块中(参见核心手册)。
#2
0
Depends on which Vert.x version you are using. 2.x requires a module. like mod-spring-appcontext. In Vert.x 3.x just create a Spring ApplicationContext in your code, typically in the entry point of your application, like your public static void main method. I can't get into more detail. Vert.x questions rarely, if ever, get noticed here.
依赖于绿色。你正在使用的x版本。2。x需要一个模块。像mod-spring-appcontext。在绿色。x 3。x在代码中创建一个Spring ApplicationContext,通常在应用程序的入口点,比如公共静态void main方法。我不能说得更详细了。绿色。在这里,x问题很少被注意到。
#3
0
I would not recommend working with vert.x on a tomcat container as there philosophies are completely different. Tomcat is a servlet container which creates different thread for each incoming call whereas vert.x works on a event-loop. If you are missing spring and will like to use its bean you can integrate it in vert.x environment and run any blocking code in worker verticles. You can see an example here : https://github.com/vert-x3/vertx-examples/tree/master/spring-examples/spring-example
我不建议和维特一起工作。在tomcat容器上的x是完全不同的。Tomcat是一个servlet容器,它为每个传入的调用创建不同的线程,而vert。x在事件循环中工作。如果你错过了春天,并且想要用它的豆子,你可以把它融入到绿色。x环境和运行任何阻塞代码在工人的verticles。您可以在这里看到一个示例:https://github.com/vert-x3/vertx-examples/tree/master/spring-examples/spring-example。