Announcement Announcement Module
Collapse
No announcement yet.
Spring Hhtp Invoker and Dynamic proxy Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Hhtp Invoker and Dynamic proxy

    Hi Every One,

    We use Apache Jmeter (Jmeter is java application, a tool for load testing client/server applications) and we have a remote component that are accessible only using Spring HTTPInvoker based calls.

    We have to build new Jmeter Sampler that will invoke a remote components that are accessible only using Spring HTTPInvoker calls.The remote component will return some objects as reponse, and the problem is we don't know in advance what's the type of that object and which method contains.

    Some one has an idea how we can do this ? I know we can use Dynamic proxy in case we don't know the inteface in advance but how we can use Spring Http Invoker with Dynamic proxy ?

    Any idea and example to follow are much appreciated,

    THank you very much in advance for your response.

    Best Regards,

  • #2
    At what point will you know what the remote interface should be?

    If you must wait until runtime, you could try something like the following:

    Code:
    public <R extends Object> R getRemoteObject(Class<R> remoteInterface) {
        HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
        httpInvokerProxyFactoryBean.setServiceInterface(remoteInterface);
        httpInvokerProxyFactoryBean.setServiceUrl("http://localhost:8080/myapp/remoteService");
        httpInvokerProxyFactoryBean.afterPropertiesSet();
        return (R) httpInvokerProxyFactoryBean.getObject();
    }

    Comment

    Working...
    X