Search code examples
javacookieshttpsjmetergwt-rpc

how to use syncproxy in Jmeter with HTTPS and cookie


I have a webapp implemented with GWT and the client / server are communicating with GWT-RPC protocol.

To perform load testing I want to use Jmeter. I have implemented a Jmeter plugin that uses SyncProxy to perform the GWT-RPC calls. In dev environment it works without any issues but I have troubles in production because the GWT-RPC calls are not working.

I get the following exception: com.gdevelop.gwt.syncrpc.exception.SyncProxyException: Missing POLICY_NAME_MISSING for service com.xxx.MyWebAppService

The main difference between the dev environment and the production environment are: - HTTPS is used instead of HTTP - On production an Apache server performs HTTP redirection if the client is not already authenticated else the request is forwarded to a tomcat instance. There're also a set of Cookies that are used to manage this session mechanism.

Is there a way to add in my Jmeter Plugin the Cookies before the call to the GWT-RPC with SyncProxy?

Anybody has some experience with this type of architecture? Regards,

Sébastien


Solution

  • As explained in my initial post the problem to perform GWT-RPC call was due to the Cookies that were not transferred from Jmeter to GWT-RPC.

    To fix the issue I have done the following:

    1. To transfer the Cookies from Jmeter to my Jmeter Plugin I have the set Jmeter properties: CookieManager.save.cookies=true. Next I was able to transfer the cookies from Jmeter environnement to my Java Plugin using simple parameters
    2. To initialize the communication of GWT-RPC proxy with the syncProxy library I have called the method SyncProxy.setBaseURL() but unfortunately this method doesn't take a cookie manager and then initialization couldn't work. To fix this issue I have performed minor code changes in SyncProxy library to use the default CookieManager. This issue is tracked on the SyncProxy GitHub https://github.com/jcricket/gwt-syncproxy/issues/49
    3. To create the stub to perform the GWT-RPC call I use the SyncProxy.createProxy() with a ProxySetting that contains a CookieManager with my default cookieManager.

    With these changes, my Jmeter Plugins can perform GWT-RPC call even on my production environment ;-)