Folks;
so far still I use Spring Remoting along with Hessian to make applications communicate with each other, which is a pleasant thing while they are living in a distributed environment. However lacking a better way to do so, I also make use of Remoting to have two different (.war) contexts in the same tomcat communicate with each other, which works reasonably well. There's one thing however:
I do have two different tomcat instances running on the same machine, and (which comes as no surprise) they're bound to different ports ("public-test" and "production" instances), and remoting only should happen within the same container. Using a Remoting Proxy bean, I usually go for something like that:
Code:<bean id="someService" class="org.springframework.remoting.caucho.HessianProxyFactoryBean"> <property name="serviceInterface" value="some.service.Interface" /> <property name="serviceUrl" value="http://localhost:8080/backend/services/someService.hessian" /> </bean>
... while, in serviceURL, having hard-coded the host-name and the port to connect to. This is sort of inconvenient as, before deploying to a host, I always have to mess with this configuration in order not to break things, and possibly all sorts of strange errors can appear once I forgot to do so.
So, I wonder whether there's a way to set up things like this
to indicate the remoting service is running at a given URL in a different context but on the same host / in the same app server. Is there a way to get something like this working?Code:... <property name="serviceURL" value="/backend/services/someService.hessian"/> ...
TIA and best regards,
Kristian


Reply With Quote