Package io.hekate.rpc
Annotation Type Rpc
-
@Inherited @Documented @Retention(RUNTIME) @Target(TYPE) public @interface Rpc
Marker annotation for RPC interfaces.This annotation that can be placed on a Java interface in order to expose its methods for remote access.
- See Also:
RpcService
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description int
minClientVersion
Minimum version of a client interface that is supported by this RPC interface.int
version
Version of RPC interface.
-
-
-
Element Detail
-
version
int version
Version of RPC interface.- Returns:
- Version of RPC interface.
- See Also:
minClientVersion()
- Default:
- 0
-
-
-
minClientVersion
int minClientVersion
Minimum version of a client interface that is supported by this RPC interface.This attribute can be used to control compatibility between the client and the server interfaces. If client detects that its version is less than the minimum required version of the server then such client will not route any RPC requests to such server.
Consider the following scenario:
- Same jar with RPC version
1
is deployed both on the client and on the server nodes - After some time a new RPC version
2
is implemented (possibly with some breaking changes of API) - New jar file with RPC version
2
is deployed on a new node - At this point, if
minClientVersion()
is set to2
then old client with version1
will know that its API is not compatible with the server version2
and will not try to route any requests to such server. - Alternatively, if
minClientVersion()
is set to1
(meaning that there were no breaking changes) then old client will still be able to route requests to the new server.
- Returns:
- Minimum version of a client interface that is compatible with the server version of this interface.
- See Also:
version()
- Default:
- 0
- Same jar with RPC version
-
-