Skip to content

Support of spring InetUtils in DefaultApplicationFactory #1323

Open
@yandersonlmi

Description

@yandersonlmi

To be able to select one of the "preferred" network interface which InetAddress doesn't allow.

Add the support of spring InetUtils to levrage the
"spring.cloud.inetutils.[...]" configurations in DefaultApplicationFactory.getLocalHost()

private final Optional<org.springframework.cloud.commons.util.InetUtils> inetUtils

protected InetAddress getLocalHost() {
  try {
    inetUtils.map(InetUtils::findFirstNonLoopbackAddress).orElse(InetAddress.getLocalHost());
    }
    catch (final UnknownHostException ex) {
      throw new IllegalArgumentException(ex.getMessage(), ex);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions