Package io.hekate.rpc

Annotation Type Rpc

    • 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:

        1. Same jar with RPC version 1 is deployed both on the client and on the server nodes
        2. After some time a new RPC version 2 is implemented (possibly with some breaking changes of API)
        3. New jar file with RPC version 2 is deployed on a new node
        4. At this point, if minClientVersion() is set to 2 then old client with version 1 will know that its API is not compatible with the server version 2 and will not try to route any requests to such server.
        5. Alternatively, if minClientVersion() is set to 1 (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