@Override
	public void start() {
		// only set the port if the nonSecurePort or securePort is 0 and port != 0
		if (port.get() != 0) {
			if (registration.getNonSecurePort() == 0) {
				registration.setNonSecurePort(port.get());
			}

			if (registration.getSecurePort() == 0 && registration.isSecure()) {
				registration.setSecurePort(port.get());
			}
		}

		// only initialize if nonSecurePort is greater than 0 and it isn't already running
		// because of containerPortInitializer below
		if (!running.get() && registration.getNonSecurePort() > 0) {
			context.publishEvent(new InstancePreRegisteredEvent(this, registration));

			serviceRegistry.register(registration);

			context.publishEvent(new InstanceRegisteredEvent<>(this, registration.getInstanceConfig()));
			running.set(true);
		}
	}
Provides an implementation of {@link AutoServiceRegistration} for registering service
instances in Eureka.

@author Dave Syer
@author Spencer Gibb
@author Jon Schneider
@author Jakub Narloch
@author Raiyan Raiyan
@author Olga Maciaszek-Sharma
spring-cloud-netflix-eureka-client/src/main/java/org/springframework/cloud/netflix/eureka/serviceregistry/EurekaAutoServiceRegistration.java