Package com.rabbitmq.client
Interface AddressResolver
-
- All Known Implementing Classes:
DnsRecordIpAddressResolver,DnsSrvRecordAddressResolver,ListAddressResolver
public interface AddressResolverStrategy interface to get the potential servers to connect to.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.List<Address>getAddresses()Get the potentialAddresses to connect to.default java.util.List<Address>maybeShuffle(java.util.List<Address> input)Optionally shuffle the list of addresses returned bygetAddresses().
-
-
-
Method Detail
-
getAddresses
java.util.List<Address> getAddresses() throws java.io.IOException
Get the potentialAddresses to connect to.- Returns:
- candidate
Addresses - Throws:
java.io.IOException- if it encounters a problem
-
maybeShuffle
default java.util.List<Address> maybeShuffle(java.util.List<Address> input)
Optionally shuffle the list of addresses returned bygetAddresses().The automatic connection recovery calls this method after
getAddresses()to pick a random address for reconnecting.The default method implementation calls
Collections.shuffle(List). Custom implementations can choose to not do any shuffling to have more predictability in the reconnection.- Parameters:
input-- Returns:
- potentially shuffled list of addresses.
-
-