Package com.rabbitmq.client
Class DnsRecordIpAddressResolver
- java.lang.Object
-
- com.rabbitmq.client.DnsRecordIpAddressResolver
-
- All Implemented Interfaces:
AddressResolver
public class DnsRecordIpAddressResolver extends Object implements AddressResolver
AddressResolver
that resolves DNS record IPs. UsesInetAddress
internally. The first returned address is used when automatic recovery is NOT enabled at theConnectionFactory
level. When automatic recovery is enabled, a random address will be picked up from the returned list ofAddress
es.
-
-
Constructor Summary
Constructors Constructor Description DnsRecordIpAddressResolver()
DnsRecordIpAddressResolver(Address address)
DnsRecordIpAddressResolver(Address address, boolean ssl)
DnsRecordIpAddressResolver(String hostname)
DnsRecordIpAddressResolver(String hostname, int port)
DnsRecordIpAddressResolver(String hostname, int port, boolean ssl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Address>
getAddresses()
Get the IP addresses from a DNS queryprotected InetAddress[]
resolveIpAddresses(String hostName)
-
-
-
Constructor Detail
-
DnsRecordIpAddressResolver
public DnsRecordIpAddressResolver(String hostname, int port, boolean ssl)
-
DnsRecordIpAddressResolver
public DnsRecordIpAddressResolver(String hostname, int port)
-
DnsRecordIpAddressResolver
public DnsRecordIpAddressResolver()
-
DnsRecordIpAddressResolver
public DnsRecordIpAddressResolver(String hostname)
-
DnsRecordIpAddressResolver
public DnsRecordIpAddressResolver(Address address)
-
DnsRecordIpAddressResolver
public DnsRecordIpAddressResolver(Address address, boolean ssl)
-
-
Method Detail
-
getAddresses
public List<Address> getAddresses() throws UnknownHostException
Get the IP addresses from a DNS query- Specified by:
getAddresses
in interfaceAddressResolver
- Returns:
- candidate
Address
es - Throws:
IOException
- if DNS resolution failsUnknownHostException
-
resolveIpAddresses
protected InetAddress[] resolveIpAddresses(String hostName) throws UnknownHostException
- Throws:
UnknownHostException
-
-