The RMI protocol uses the JDK standard java.rmi.*
Implementation, using a block short connection and JDK standard serialization.
Serializable
interface-Dsun.rmi.transport.tcp.responseTimeout=3000
,see the RMI configuration belowdubbo.service.protocol=rmi
java -Dsun.rmi.transport.tcp.responseTimeout=3000
more RMI options please check JDK Document
If the service interface implement the java.rmi.Remote
interface, it can interoperate with the native RMI, ie:
If the service interface doesn’t implement the java.rmi.Remote
interface:
com.xxx.XxxService$Remote
interface and implement the java.rmi.Remote
interface, expose the service as this interface,<dubbo: protocol name = 'rmi' codec = 'spring' />
is set, the$Remote
interface will not be generated, but Spring’s RmiInvocationHandler
interface will be used to expose services.configure RMI protocol:
<dubbo:protocol name="rmi" port="1099" />
configure provider level default protocol:
<dubbo:provider protocol="rmi" />
configure service level default protocol:
<dubbo:service protocol="rmi" />
configure multiple port:
<dubbo:protocol id="rmi1" name="rmi" port="1099" />
<dubbo:protocol id="rmi2" name="rmi" port="2099" />
<dubbo:service protocol="rmi1" />
Compatible with Spring:
<dubbo:protocol name="rmi" codec="spring" />
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.