Announcement Announcement Module
No announcement yet.
RmiServiceExporter.setServicePort query Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • RmiServiceExporter.setServicePort query

    Hi Guys,
    Can someone explain what is the significance of the setServicePort() method? I have an interface that is exposed over RMI as follows:
    <bean class="org.springframework.remoting.rmi.RmiServiceExporter">
    	<property name="serviceName" value="TopologyService"/>
    	<property name="service" ref="topologyManager"/>
    	<property name="serviceInterface" value="package.service.ITopologyService"/>
    	<property name="registryPort" value="50042"/>
    	<property name="servicePort" value="50043"/>
    I can then connect successfully to the service as follows:

    <bean id="topologyService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
    	<property name="serviceUrl" value="rmi://localhost:50042/TopologyService"/>
    	<property name="serviceInterface" value="package.service.ITopologyService"/>		

    My question is what is the point in specifying the port number of the service if I can connect without it? Or will this fall over in a more secure environment? If this is the case, how do I specify the port on the client side, I assume it should be part of the URL e.g.

    <property name="serviceUrl" value="rmi://localhost:50042/TopologyService:50043"/>

    or something similar?

    Thanks for any info

  • #2
    The stub you get from the registry contains the servicePort, you don't need to do anything about it client side.


    • #3
      Nice one, thanks for the reply! OK so the client does not actually care, he just uses the stub he gets back and doesnt know the difference? The situation I have is that one port is secure and the other is unsecure and how the client knows which one to connect to....but from what you are saying the client doesnt need this info, just leave the URL as it is and use what we get back...

      Sorry above sounds repetitive, just wanna be clear in my head