GWT RPC - 每个应用程序提供多个RPC服务 [英] GWT RPC - Multiple RPC Services Per App

查看:91
本文介绍了GWT RPC - 每个应用程序提供多个RPC服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用具有一个大型RPC服务的GWT应用程序。它有超过100种方法,所有这些方法都做不同的事情。如果我将其分解为多个RPC服务,会得到什么样的性能优势/障碍?我相信我必须为每一个创建一个新的servlet。

所以我的主要问题是:
GWT是否为每个正在运行的客户端创建一个新的RPC servlet?
如果我有两个RPC服务,GWT会有两个servlet用于一个应用程序吗?
有两个RPC服务会导致任何性能问题。当前(在一个tomcat实例上有10-15个并发用户)

解决方案


什么样的性能优势/如果我把它分成多个RPC服务,我会得到什么样的阻碍?


我相信在这方面它没有任何改变。 >


我相信我必须为每一个创建一个新的servlet。


不一定。你可以有一个 RemoteServiceServlet 实现几个 RemoteService 接口。您必须在所有接口上为客户端设置相同的 @RemoteServiceRelativePath ,以便客户端使用相同的URL,但您也可以将同一个servlet映射到多个不同的URL servlet-mapping 具有相同的 servlet-name )。



< blockquote>

GWT是否为每个正在运行的客户端创建一个新的RPC servlet?

GWT不是 >创建一个新的RPC servlet ,如果您将您的Web应用程序托管在Tomcat中,那么Tomcat将创建servlet实例(通常每个类只有一个实例)。


I am currently working with a GWT app that has one large RPC service. It has over 100 methods, all of which do different things. What kind of performance benefit / hindrance would I get if I split this into multiple RPC services? I believe I'd have to make a new servlet for each one.

So my main questions are: Does GWT create a new RPC servlet for each running client? Would GWT have two servlets for one App if I have two RPC services? Would having two RPC services cause any performance issues. currently (10-15 concurrent users on one tomcat instance)

解决方案

What kind of performance benefit / hindrance would I get if I split this into multiple RPC services?

I believe it'd change nothing in this respect.

I believe I'd have to make a new servlet for each one.

Not necessarily. You could have a single RemoteServiceServlet implementing several RemoteService interfaces. You'd have to set the same @RemoteServiceRelativePath on all your interfaces for the client to use the same URL, but you could also map that same servlet to several distinct URLs (several servlet-mapping with the same servlet-name).

Does GWT create a new RPC servlet for each running client?

GWT doesn't create a new RPC servlet, if you host your web app in Tomcat, then Tomcat odes create servlet instances (generally a single instance per class).

这篇关于GWT RPC - 每个应用程序提供多个RPC服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆