Interface MemberAddressProvider


  • public interface MemberAddressProvider
    IMPORTANT This interface is not intended to provide addresses of other cluster members with which the hazelcast instance will form a cluster. This is an SPI for advanced use in cases where the AddressPicker implementation does not pick suitable addresses to bind to and publish to other cluster members. For instance, this could allow easier deployment in some cases when running on Docker, AWS or other cloud environments. That said, if you are just starting with Hazelcast, you will probably want to set the member addresses by using TcpIpConfig.setMembers(List), MulticastConfig or adding a discovery strategy. Allow to customize: 1. What address Hazelcast will bind to 2. What address Hazelcast will advertise to other members on which they can bind to

    This is practical in some cloud environments where the default strategy is not yielding good results.

    See Also:
    NetworkConfig.setMemberAddressProviderConfig(com.hazelcast.config.MemberAddressProviderConfig)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.net.InetSocketAddress getBindAddress()
      What address should Hazelcast bind to.
      java.net.InetSocketAddress getBindAddress​(com.hazelcast.instance.EndpointQualifier qualifier)  
      java.net.InetSocketAddress getPublicAddress()
      What address should Hazelcast advertise to other members and clients.
      java.net.InetSocketAddress getPublicAddress​(com.hazelcast.instance.EndpointQualifier qualifier)  
    • Method Detail

      • getBindAddress

        java.net.InetSocketAddress getBindAddress()
        What address should Hazelcast bind to. When the port is set to 0 then it will use a port as configured in the Hazelcast network configuration.
        Returns:
        address to bind to
        See Also:
        NetworkConfig.getPort(), NetworkConfig.isPortAutoIncrement()
      • getBindAddress

        java.net.InetSocketAddress getBindAddress​(com.hazelcast.instance.EndpointQualifier qualifier)
      • getPublicAddress

        java.net.InetSocketAddress getPublicAddress()
        What address should Hazelcast advertise to other members and clients. When the port is set to 0 then it will broadcast the same port that it is bound to.
        Returns:
        address to advertise to others
      • getPublicAddress

        java.net.InetSocketAddress getPublicAddress​(com.hazelcast.instance.EndpointQualifier qualifier)